aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--fs/btrfs/tree-log.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/fs/btrfs/tree-log.c b/fs/btrfs/tree-log.c
index 5256cddf3a43..960ea49a7a0f 100644
--- a/fs/btrfs/tree-log.c
+++ b/fs/btrfs/tree-log.c
@@ -3578,9 +3578,16 @@ static noinline int log_dir_items(struct btrfs_trans_handle *trans,
3578 } 3578 }
3579 btrfs_release_path(path); 3579 btrfs_release_path(path);
3580 3580
3581 /* find the first key from this transaction again */ 3581 /*
3582 * Find the first key from this transaction again. See the note for
3583 * log_new_dir_dentries, if we're logging a directory recursively we
3584 * won't be holding its i_mutex, which means we can modify the directory
3585 * while we're logging it. If we remove an entry between our first
3586 * search and this search we'll not find the key again and can just
3587 * bail.
3588 */
3582 ret = btrfs_search_slot(NULL, root, &min_key, path, 0, 0); 3589 ret = btrfs_search_slot(NULL, root, &min_key, path, 0, 0);
3583 if (WARN_ON(ret != 0)) 3590 if (ret != 0)
3584 goto done; 3591 goto done;
3585 3592
3586 /* 3593 /*