• Boris Burkov's avatar
    btrfs: add comment about locking in cow_file_range_inline() · f8e9f4a7
    Boris Burkov authored
    Add a comment to document the complicated locked_page unlock logic in
    cow_file_range_inline. The specifically tricky part is that a caller
    just up the stack converts ret == 0 to ret == 1 and then another
    caller far up the callstack handles ret == 1 as a success, AND returns
    without cleanup in that case, both of which "feel" unnatural and led to
    the original bug.
    
    Try to document that somewhat specific callstack logic here to explain
    the weird un-setting of locked_folio on success.
    Reviewed-by: default avatarQu Wenruo <wqu@suse.com>
    Signed-off-by: default avatarBoris Burkov <boris@bur.io>
    Signed-off-by: default avatarDavid Sterba <dsterba@suse.com>
    f8e9f4a7
inode.c 290 KB