On 10.09.19 г. 10:40 ч., Qu Wenruo wrote:
> The following comment shows up in btrfs_search_slot() with out much
> sense:
>
> /*
> * setup the path here so we can release it under lock
> * contention with the cow code
> */
> if (cow) {
> /* code touching path->lock[] is far away from here */
> }
>
> It turns out that just some stalled comment which is not cleaned up
> properly.
>
> The original code is introduced in commit 65b51a009e29
> ("btrfs_search_slot: reduce lock contention by cowing in two stages"):
> +
> + /*
> + * setup the path here so we can release it under lock
> + * contention with the cow code
> + */
> + p->nodes[level] = b;
> + if (!p->skip_locking)
> + p->locks[level] = 1;
> +
>
> But in current code base, we have different timing modifying path lock,
> so just remove that stalled comment.
>
> Signed-off-by: Qu Wenruo <w...@suse.com>
Reviewed-by: Nikolay Borisov <nbori...@suse.com>
> ---
> fs/btrfs/ctree.c | 4 ----
> 1 file changed, 4 deletions(-)
>
> diff --git a/fs/btrfs/ctree.c b/fs/btrfs/ctree.c
> index 3be8b32c0d37..a2e264190eee 100644
> --- a/fs/btrfs/ctree.c
> +++ b/fs/btrfs/ctree.c
> @@ -2764,10 +2764,6 @@ int btrfs_search_slot(struct btrfs_trans_handle
> *trans, struct btrfs_root *root,
> int dec = 0;
> level = btrfs_header_level(b);
>
> - /*
> - * setup the path here so we can release it under lock
> - * contention with the cow code
> - */
> if (cow) {
> bool last_level = (level == (BTRFS_MAX_LEVEL - 1));
>
>