diff mbox series

[5/7] btrfs: Document logic in async_cow_submit

Message ID 20190103085005.32053-6-nborisov@suse.com (mailing list archive)
State New, archived
Headers show
Series More misc fixes | expand

Commit Message

Nikolay Borisov Jan. 3, 2019, 8:50 a.m. UTC
Add a comment explaining when ->inode could be null and why we always
perform the ->async_delalloc_pages modification.

Signed-off-by: Nikolay Borisov <nborisov@suse.com>
---
 fs/btrfs/inode.c | 6 ++++++
 1 file changed, 6 insertions(+)
diff mbox series

Patch

diff --git a/fs/btrfs/inode.c b/fs/btrfs/inode.c
index 1a7f790b68e8..41ad0d06b3d4 100644
--- a/fs/btrfs/inode.c
+++ b/fs/btrfs/inode.c
@@ -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
+	 * adjust ->async_delalloc_pages always as its paired to the init
+	 * happening in cow_file_range_async
+	 */
 	if (async_cow->inode)
 		submit_compressed_extents(async_cow);
 }