[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <f60dacead3da4ab78edd225749d698f8e621f577.camel@kernel.org>
Date: Thu, 07 Jul 2022 06:56:08 -0400
From: Jeff Layton <jlayton@...nel.org>
To: xiubli@...hat.com, dhowells@...hat.com, idryomov@...il.com
Cc: marc.dionne@...istor.com, willy@...radead.org,
keescook@...omium.org, kirill.shutemov@...ux.intel.com,
william.kucharski@...cle.com, linux-afs@...ts.infradead.org,
linux-kernel@...r.kernel.org, ceph-devel@...r.kernel.org,
linux-cachefs@...hat.com, vshankar@...hat.com
Subject: Re: [PATCH v3 2/2] afs: unlock the folio when vnode is marked
deleted
On Thu, 2022-07-07 at 12:51 +0800, xiubli@...hat.com wrote:
> From: Xiubo Li <xiubli@...hat.com>
>
> The check_write_begin() should unlock the folio if return non-zero,
> otherwise locked.
>
> URL: https://tracker.ceph.com/issues/56423
> Signed-off-by: Xiubo Li <xiubli@...hat.com>
> ---
> fs/afs/file.c | 8 +++++++-
> 1 file changed, 7 insertions(+), 1 deletion(-)
>
> diff --git a/fs/afs/file.c b/fs/afs/file.c
> index afacce797fb9..b23e7b5a48ad 100644
> --- a/fs/afs/file.c
> +++ b/fs/afs/file.c
> @@ -379,7 +379,13 @@ static int afs_check_write_begin(struct file *file, loff_t pos, unsigned len,
> {
> struct afs_vnode *vnode = AFS_FS_I(file_inode(file));
>
> - return test_bit(AFS_VNODE_DELETED, &vnode->flags) ? -ESTALE : 0;
> + if (test_bit(AFS_VNODE_DELETED, &vnode->flags)) {
> + folio_unlock(*folio);
> + folio_put(*folio);
Don't you also need this?
*folio = NULL;
> + return -ESTALE;
> + }
> +
> + return 0;
> }
>
> static void afs_free_request(struct netfs_io_request *rreq)
--
Jeff Layton <jlayton@...nel.org>
Powered by blists - more mailing lists