[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <CAL3q7H7d92JC_ZHp2cZ_tWyy-+qQkqG9nVgYSTi06+GAbYpNbg@mail.gmail.com>
Date: Fri, 2 Aug 2024 13:29:08 +0100
From: Filipe Manana <fdmanana@...nel.org>
To: Edward Adam Davis <eadavis@...com>
Cc: syzbot+7dbbb74af6291b5a5a8b@...kaller.appspotmail.com, clm@...com,
dsterba@...e.com, fdmanana@...e.com, hreitz@...hat.com, josef@...icpanda.com,
linux-btrfs@...r.kernel.org, linux-kernel@...r.kernel.org,
syzkaller-bugs@...glegroups.com
Subject: Re: [PATCH] btrfs: Add missing skip-lock for locks
On Fri, Aug 2, 2024 at 12:59 PM Edward Adam Davis <eadavis@...com> wrote:
>
> The commit 939b656bc8ab missing a skip-lock in btrfs_sync_file,
> it cause syzbot report WARNING: bad unlock balance in btrfs_direct_write.
>
> Fixes: 939b656bc8ab ("btrfs: fix corruption after buffer fault in during direct IO append write")
> Reported-and-tested-by: syzbot+7dbbb74af6291b5a5a8b@...kaller.appspotmail.com
> Closes: https://syzkaller.appspot.com/bug?extid=7dbbb74af6291b5a5a8b
> Signed-off-by: Edward Adam Davis <eadavis@...com>
I had already a submitted a fix for this hours ago:
https://lore.kernel.org/linux-btrfs/7aa71067c2946ea3a7165f26899324e0df7d772e.1722588255.git.fdmanana@suse.com/
Thanks.
> ---
> fs/btrfs/file.c | 5 ++++-
> 1 file changed, 4 insertions(+), 1 deletion(-)
>
> diff --git a/fs/btrfs/file.c b/fs/btrfs/file.c
> index 9f10a9f23fcc..9914419f3b7d 100644
> --- a/fs/btrfs/file.c
> +++ b/fs/btrfs/file.c
> @@ -1868,7 +1868,10 @@ int btrfs_sync_file(struct file *file, loff_t start, loff_t end, int datasync)
>
> out_release_extents:
> btrfs_release_log_ctx_extents(&ctx);
> - btrfs_inode_unlock(inode, BTRFS_ILOCK_MMAP);
> + if (skip_ilock)
> + up_write(&inode->i_mmap_lock);
> + else
> + btrfs_inode_unlock(inode, BTRFS_ILOCK_MMAP);
> goto out;
> }
>
> --
> 2.43.0
>
>
Powered by blists - more mailing lists