Skip to content

Commit

Permalink
btrfs: Document logic regarding inode in async_cow_submit
Browse files Browse the repository at this point in the history
Add a comment explaining when ->inode could be NULL and why we always
perform the ->async_delalloc_pages modification.

Signed-off-by: Nikolay Borisov <[email protected]>
Signed-off-by: David Sterba <[email protected]>
  • Loading branch information
lorddoskias authored and kdave committed Feb 25, 2019
1 parent a1d64ba commit 4546d17
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions fs/btrfs/inode.c
Original file line number Diff line number Diff line change
Expand Up @@ -1165,6 +1165,12 @@ static noinline void async_cow_submit(struct btrfs_work *work)
5 * SZ_1M)
cond_wake_up_nomb(&fs_info->async_submit_wait);

/*
* ->inode could be NULL if async_cow_start has failed to compress,
* in which case we don't have anything to submit, yet we need to
* always adjust ->async_delalloc_pages as its paired with the init
* happening in cow_file_range_async
*/
if (async_cow->inode)
submit_compressed_extents(async_cow);
}
Expand Down

0 comments on commit 4546d17

Please sign in to comment.