From: Zizhi Wo <wozizhi@huawei.com>
To: <dhowells@redhat.com>, <steved@redhat.com>,
<Trond.Myklebust@netapp.com>, <viro@zeniv.linux.org.uk>
Cc: <netfs@lists.linux.dev>, <linux-kernel@vger.kernel.org>,
<yangerkun@huawei.com>, Gao Xiang <hsiangkao@linux.alibaba.com>,
<jefflexu@linux.alibaba>, <zhujia.zj@bytedance.com>,
<libaokun1@huawei.com>, <houtao1@huawei.com>,
Yu Kuai <yukuai3@huawei.com>
Subject: Re: [PATCH] cachefiles: modify inappropriate error return value in cachefiles_daemon_secctx
Date: Tue, 18 Jun 2024 21:37:37 +0800 [thread overview]
Message-ID: <6ffcbc02-b059-4e56-8900-53820d2d3caa@huawei.com> (raw)
In-Reply-To: <20240604071334.3982185-1-wozizhi@huawei.com>
friendly ping
在 2024/6/4 15:13, Zizhi Wo 写道:
> In cachefiles_daemon_secctx(), if it is detected that secctx has been
> written to the cache, the error code returned is -EINVAL, which is
> inappropriate and does not distinguish the situation well.
>
> Like cachefiles_daemon_dir(), fix this issue by return -EEXIST to the user
> if it has already been defined once.
>
> Fixes: 9ae326a69004 ("CacheFiles: A cache that backs onto a mounted filesystem")
> Signed-off-by: Zizhi Wo <wozizhi@huawei.com>
> ---
> fs/cachefiles/daemon.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/fs/cachefiles/daemon.c b/fs/cachefiles/daemon.c
> index 6465e2574230..1b14849804f3 100644
> --- a/fs/cachefiles/daemon.c
> +++ b/fs/cachefiles/daemon.c
> @@ -586,7 +586,7 @@ static int cachefiles_daemon_secctx(struct cachefiles_cache *cache, char *args)
>
> if (cache->secctx) {
> pr_err("Second security context specified\n");
> - return -EINVAL;
> + return -EEXIST;
> }
>
> secctx = kstrdup(args, GFP_KERNEL);
prev parent reply other threads:[~2024-06-18 13:37 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-06-04 7:13 [PATCH] cachefiles: modify inappropriate error return value in cachefiles_daemon_secctx Zizhi Wo
2024-06-18 13:37 ` Zizhi Wo [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=6ffcbc02-b059-4e56-8900-53820d2d3caa@huawei.com \
--to=wozizhi@huawei.com \
--cc=Trond.Myklebust@netapp.com \
--cc=dhowells@redhat.com \
--cc=houtao1@huawei.com \
--cc=hsiangkao@linux.alibaba.com \
--cc=jefflexu@linux.alibaba \
--cc=libaokun1@huawei.com \
--cc=linux-kernel@vger.kernel.org \
--cc=netfs@lists.linux.dev \
--cc=steved@redhat.com \
--cc=viro@zeniv.linux.org.uk \
--cc=yangerkun@huawei.com \
--cc=yukuai3@huawei.com \
--cc=zhujia.zj@bytedance.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox