LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
* [PATCH] fs/ceph/export: remove unused variable 'err'
@ 2020-03-03 16:21 Qiujun Huang
2020-03-04 20:36 ` Jeff Layton
0 siblings, 1 reply; 3+ messages in thread
From: Qiujun Huang @ 2020-03-03 16:21 UTC (permalink / raw)
To: jlayton; +Cc: sage, idryomov, ceph-devel, linux-kernel, Qiujun Huang
fix gcc '-Wunused-but-set-variable' warning:
fs/ceph/export.c: In function ‘__get_parent’:
fs/ceph/export.c:294:6: warning: variable ‘err’ set but not used [-Wunused-but-set-variable]
int err;
and needn't use the return value of ceph_mdsc_create_request.
Signed-off-by: Qiujun Huang <hqjagain@gmail.com>
---
fs/ceph/export.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/fs/ceph/export.c b/fs/ceph/export.c
index b6bfa94..b7bb41c 100644
--- a/fs/ceph/export.c
+++ b/fs/ceph/export.c
@@ -291,7 +291,6 @@ static struct dentry *__get_parent(struct super_block *sb,
struct ceph_mds_request *req;
struct inode *inode;
int mask;
- int err;
req = ceph_mdsc_create_request(mdsc, CEPH_MDS_OP_LOOKUPPARENT,
USE_ANY_MDS);
@@ -314,7 +313,7 @@ static struct dentry *__get_parent(struct super_block *sb,
req->r_args.getattr.mask = cpu_to_le32(mask);
req->r_num_caps = 1;
- err = ceph_mdsc_do_request(mdsc, NULL, req);
+ ceph_mdsc_do_request(mdsc, NULL, req);
inode = req->r_target_inode;
if (inode)
ihold(inode);
--
1.8.3.1
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] fs/ceph/export: remove unused variable 'err'
2020-03-03 16:21 [PATCH] fs/ceph/export: remove unused variable 'err' Qiujun Huang
@ 2020-03-04 20:36 ` Jeff Layton
2020-03-05 0:45 ` Qiujun Huang
0 siblings, 1 reply; 3+ messages in thread
From: Jeff Layton @ 2020-03-04 20:36 UTC (permalink / raw)
To: Qiujun Huang; +Cc: sage, idryomov, ceph-devel, linux-kernel
On Wed, 2020-03-04 at 00:21 +0800, Qiujun Huang wrote:
> fix gcc '-Wunused-but-set-variable' warning:
> fs/ceph/export.c: In function ‘__get_parent’:
> fs/ceph/export.c:294:6: warning: variable ‘err’ set but not used [-Wunused-but-set-variable]
> int err;
>
> and needn't use the return value of ceph_mdsc_create_request.
>
> Signed-off-by: Qiujun Huang <hqjagain@gmail.com>
> ---
> fs/ceph/export.c | 3 +--
> 1 file changed, 1 insertion(+), 2 deletions(-)
>
> diff --git a/fs/ceph/export.c b/fs/ceph/export.c
> index b6bfa94..b7bb41c 100644
> --- a/fs/ceph/export.c
> +++ b/fs/ceph/export.c
> @@ -291,7 +291,6 @@ static struct dentry *__get_parent(struct super_block *sb,
> struct ceph_mds_request *req;
> struct inode *inode;
> int mask;
> - int err;
>
> req = ceph_mdsc_create_request(mdsc, CEPH_MDS_OP_LOOKUPPARENT,
> USE_ANY_MDS);
> @@ -314,7 +313,7 @@ static struct dentry *__get_parent(struct super_block *sb,
> req->r_args.getattr.mask = cpu_to_le32(mask);
>
> req->r_num_caps = 1;
> - err = ceph_mdsc_do_request(mdsc, NULL, req);
> + ceph_mdsc_do_request(mdsc, NULL, req);
> inode = req->r_target_inode;
> if (inode)
> ihold(inode);
I think we probably ought to just return ERR_PTR(err) in that case
instead of discarding it. It looks like today we'll end up returning
ENOENT when that errors out which doesn't seem right when there is a
different issue.
--
Jeff Layton <jlayton@kernel.org>
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] fs/ceph/export: remove unused variable 'err'
2020-03-04 20:36 ` Jeff Layton
@ 2020-03-05 0:45 ` Qiujun Huang
0 siblings, 0 replies; 3+ messages in thread
From: Qiujun Huang @ 2020-03-05 0:45 UTC (permalink / raw)
To: Jeff Layton; +Cc: sage, idryomov, ceph-devel, LKML
On Thu, Mar 5, 2020 at 4:36 AM Jeff Layton <jlayton@kernel.org> wrote:
>
> I think we probably ought to just return ERR_PTR(err) in that case
> instead of discarding it. It looks like today we'll end up returning
> ENOENT when that errors out which doesn't seem right when there is a
> different issue.
I get that, thanks.
>
> --
> Jeff Layton <jlayton@kernel.org>
>
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2020-03-05 0:45 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-03-03 16:21 [PATCH] fs/ceph/export: remove unused variable 'err' Qiujun Huang
2020-03-04 20:36 ` Jeff Layton
2020-03-05 0:45 ` Qiujun Huang
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).