[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20220319202704.2532521-1-jakobkoschel@gmail.com>
Date: Sat, 19 Mar 2022 21:27:04 +0100
From: Jakob Koschel <jakobkoschel@...il.com>
To: Chuck Lever <chuck.lever@...cle.com>
Cc: Jakob Koschel <jakobkoschel@...il.com>,
linux-kernel@...r.kernel.org, linux-nfs@...r.kernel.org,
Mike Rapoport <rppt@...nel.org>,
"Brian Johannesmeyer" <bjohannesmeyer@...il.com>,
Cristiano Giuffrida <c.giuffrida@...nl>,
"Bos, H.J." <h.j.bos@...nl>
Subject: [PATCH] nfsd: fix using the correct variable for sizeof()
While the original code is valid, it is not the obvious choice for the
sizeof() call and in preparation to limit the scope of the list iterator
variable the sizeof should be changed to the size of the destination.
Signed-off-by: Jakob Koschel <jakobkoschel@...il.com>
---
fs/nfsd/nfs4layouts.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/fs/nfsd/nfs4layouts.c b/fs/nfsd/nfs4layouts.c
index 6d1b5bb051c5..2c05692a9abf 100644
--- a/fs/nfsd/nfs4layouts.c
+++ b/fs/nfsd/nfs4layouts.c
@@ -422,7 +422,7 @@ nfsd4_insert_layout(struct nfsd4_layoutget *lgp, struct nfs4_layout_stateid *ls)
new = kmem_cache_alloc(nfs4_layout_cache, GFP_KERNEL);
if (!new)
return nfserr_jukebox;
- memcpy(&new->lo_seg, seg, sizeof(lp->lo_seg));
+ memcpy(&new->lo_seg, seg, sizeof(new->lo_seg));
new->lo_state = ls;
spin_lock(&fp->fi_lock);
base-commit: 34e047aa16c0123bbae8e2f6df33e5ecc1f56601
--
2.25.1
Powered by blists - more mailing lists