Commit 4546d178 authored by Nikolay Borisov's avatar Nikolay Borisov Committed by David Sterba

btrfs: Document logic regarding inode in async_cow_submit

Add a comment explaining when ->inode could be NULL and why we always
perform the ->async_delalloc_pages modification.
Signed-off-by: default avatarNikolay Borisov <nborisov@suse.com>
Signed-off-by: default avatarDavid Sterba <dsterba@suse.com>
parent a1d64ba6
...@@ -1165,6 +1165,12 @@ static noinline void async_cow_submit(struct btrfs_work *work) ...@@ -1165,6 +1165,12 @@ static noinline void async_cow_submit(struct btrfs_work *work)
5 * SZ_1M) 5 * SZ_1M)
cond_wake_up_nomb(&fs_info->async_submit_wait); 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) if (async_cow->inode)
submit_compressed_extents(async_cow); submit_compressed_extents(async_cow);
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment