* [PATCH] fs/locks: fix fcntl_getlk64/fcntl_setlk64 stub prototypes
@ 2021-11-23 16:05 Arnd Bergmann
2021-11-23 16:07 ` Christoph Hellwig
` (2 more replies)
0 siblings, 3 replies; 4+ messages in thread
From: Arnd Bergmann @ 2021-11-23 16:05 UTC (permalink / raw)
To: Alexander Viro, Russell King (Oracle), Arnd Bergmann, Jeff Layton
Cc: kernel test robot, Christoph Hellwig, Christian Brauner,
Jan Kara, Jens Axboe, Andrew Morton, linux-fsdevel, linux-kernel
From: Arnd Bergmann <arnd@arndb.de>
My patch to rework oabi fcntl64() introduced a harmless
sparse warning when file locking is disabled:
arch/arm/kernel/sys_oabi-compat.c:251:51: sparse: sparse: incorrect type in argument 3 (different address spaces) @@ expected struct flock64 [noderef] __user *user @@ got struct flock64 * @@
arch/arm/kernel/sys_oabi-compat.c:251:51: sparse: expected struct flock64 [noderef] __user *user
arch/arm/kernel/sys_oabi-compat.c:251:51: sparse: got struct flock64 *
arch/arm/kernel/sys_oabi-compat.c:265:55: sparse: sparse: incorrect type in argument 4 (different address spaces) @@ expected struct flock64 [noderef] __user *user @@ got struct flock64 * @@
arch/arm/kernel/sys_oabi-compat.c:265:55: sparse: expected struct flock64 [noderef] __user *user
arch/arm/kernel/sys_oabi-compat.c:265:55: sparse: got struct flock64 *
When file locking is enabled, everything works correctly and the
right data gets passed, but the stub declarations in linux/fs.h
did not get modified when the calling conventions changed in an
earlier patch.
Reported-by: kernel test robot <lkp@intel.com>
Fixes: 7e2d8c29ecdd ("ARM: 9111/1: oabi-compat: rework fcntl64() emulation")
Fixes: a75d30c77207 ("fs/locks: pass kernel struct flock to fcntl_getlk/setlk")
Cc: Christoph Hellwig <hch@lst.de>
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
---
include/linux/fs.h | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/include/linux/fs.h b/include/linux/fs.h
index 1cb616fc1105..698d92567841 100644
--- a/include/linux/fs.h
+++ b/include/linux/fs.h
@@ -1220,13 +1220,13 @@ static inline int fcntl_setlk(unsigned int fd, struct file *file,
#if BITS_PER_LONG == 32
static inline int fcntl_getlk64(struct file *file, unsigned int cmd,
- struct flock64 __user *user)
+ struct flock64 *user)
{
return -EINVAL;
}
static inline int fcntl_setlk64(unsigned int fd, struct file *file,
- unsigned int cmd, struct flock64 __user *user)
+ unsigned int cmd, struct flock64 *user)
{
return -EACCES;
}
--
2.29.2
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH] fs/locks: fix fcntl_getlk64/fcntl_setlk64 stub prototypes
2021-11-23 16:05 [PATCH] fs/locks: fix fcntl_getlk64/fcntl_setlk64 stub prototypes Arnd Bergmann
@ 2021-11-23 16:07 ` Christoph Hellwig
2021-11-23 16:34 ` Jeff Layton
2021-11-24 9:15 ` Christian Brauner
2 siblings, 0 replies; 4+ messages in thread
From: Christoph Hellwig @ 2021-11-23 16:07 UTC (permalink / raw)
To: Arnd Bergmann
Cc: Alexander Viro, Russell King (Oracle),
Arnd Bergmann, Jeff Layton, kernel test robot, Christoph Hellwig,
Christian Brauner, Jan Kara, Jens Axboe, Andrew Morton,
linux-fsdevel, linux-kernel
Looks good,
Reviewed-by: Christoph Hellwig <hch@lst.de>
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] fs/locks: fix fcntl_getlk64/fcntl_setlk64 stub prototypes
2021-11-23 16:05 [PATCH] fs/locks: fix fcntl_getlk64/fcntl_setlk64 stub prototypes Arnd Bergmann
2021-11-23 16:07 ` Christoph Hellwig
@ 2021-11-23 16:34 ` Jeff Layton
2021-11-24 9:15 ` Christian Brauner
2 siblings, 0 replies; 4+ messages in thread
From: Jeff Layton @ 2021-11-23 16:34 UTC (permalink / raw)
To: Arnd Bergmann, Alexander Viro, Russell King (Oracle), Arnd Bergmann
Cc: kernel test robot, Christoph Hellwig, Christian Brauner,
Jan Kara, Jens Axboe, Andrew Morton, linux-fsdevel, linux-kernel
On Tue, 2021-11-23 at 17:05 +0100, Arnd Bergmann wrote:
> From: Arnd Bergmann <arnd@arndb.de>
>
> My patch to rework oabi fcntl64() introduced a harmless
> sparse warning when file locking is disabled:
>
> arch/arm/kernel/sys_oabi-compat.c:251:51: sparse: sparse: incorrect type in argument 3 (different address spaces) @@ expected struct flock64 [noderef] __user *user @@ got struct flock64 * @@
> arch/arm/kernel/sys_oabi-compat.c:251:51: sparse: expected struct flock64 [noderef] __user *user
> arch/arm/kernel/sys_oabi-compat.c:251:51: sparse: got struct flock64 *
> arch/arm/kernel/sys_oabi-compat.c:265:55: sparse: sparse: incorrect type in argument 4 (different address spaces) @@ expected struct flock64 [noderef] __user *user @@ got struct flock64 * @@
> arch/arm/kernel/sys_oabi-compat.c:265:55: sparse: expected struct flock64 [noderef] __user *user
> arch/arm/kernel/sys_oabi-compat.c:265:55: sparse: got struct flock64 *
>
> When file locking is enabled, everything works correctly and the
> right data gets passed, but the stub declarations in linux/fs.h
> did not get modified when the calling conventions changed in an
> earlier patch.
>
> Reported-by: kernel test robot <lkp@intel.com>
> Fixes: 7e2d8c29ecdd ("ARM: 9111/1: oabi-compat: rework fcntl64() emulation")
> Fixes: a75d30c77207 ("fs/locks: pass kernel struct flock to fcntl_getlk/setlk")
> Cc: Christoph Hellwig <hch@lst.de>
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>
> ---
> include/linux/fs.h | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/include/linux/fs.h b/include/linux/fs.h
> index 1cb616fc1105..698d92567841 100644
> --- a/include/linux/fs.h
> +++ b/include/linux/fs.h
> @@ -1220,13 +1220,13 @@ static inline int fcntl_setlk(unsigned int fd, struct file *file,
>
> #if BITS_PER_LONG == 32
> static inline int fcntl_getlk64(struct file *file, unsigned int cmd,
> - struct flock64 __user *user)
> + struct flock64 *user)
> {
> return -EINVAL;
> }
>
> static inline int fcntl_setlk64(unsigned int fd, struct file *file,
> - unsigned int cmd, struct flock64 __user *user)
> + unsigned int cmd, struct flock64 *user)
> {
> return -EACCES;
> }
Thanks Arnd. I'll pull this in for v5.17. Let me know if it needs to go
in sooner.
Thanks,
--
Jeff Layton <jlayton@kernel.org>
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] fs/locks: fix fcntl_getlk64/fcntl_setlk64 stub prototypes
2021-11-23 16:05 [PATCH] fs/locks: fix fcntl_getlk64/fcntl_setlk64 stub prototypes Arnd Bergmann
2021-11-23 16:07 ` Christoph Hellwig
2021-11-23 16:34 ` Jeff Layton
@ 2021-11-24 9:15 ` Christian Brauner
2 siblings, 0 replies; 4+ messages in thread
From: Christian Brauner @ 2021-11-24 9:15 UTC (permalink / raw)
To: Arnd Bergmann
Cc: Alexander Viro, Russell King (Oracle),
Arnd Bergmann, Jeff Layton, kernel test robot, Christoph Hellwig,
Jan Kara, Jens Axboe, Andrew Morton, linux-fsdevel, linux-kernel
On Tue, Nov 23, 2021 at 05:05:07PM +0100, Arnd Bergmann wrote:
> From: Arnd Bergmann <arnd@arndb.de>
>
> My patch to rework oabi fcntl64() introduced a harmless
> sparse warning when file locking is disabled:
>
> arch/arm/kernel/sys_oabi-compat.c:251:51: sparse: sparse: incorrect type in argument 3 (different address spaces) @@ expected struct flock64 [noderef] __user *user @@ got struct flock64 * @@
> arch/arm/kernel/sys_oabi-compat.c:251:51: sparse: expected struct flock64 [noderef] __user *user
> arch/arm/kernel/sys_oabi-compat.c:251:51: sparse: got struct flock64 *
> arch/arm/kernel/sys_oabi-compat.c:265:55: sparse: sparse: incorrect type in argument 4 (different address spaces) @@ expected struct flock64 [noderef] __user *user @@ got struct flock64 * @@
> arch/arm/kernel/sys_oabi-compat.c:265:55: sparse: expected struct flock64 [noderef] __user *user
> arch/arm/kernel/sys_oabi-compat.c:265:55: sparse: got struct flock64 *
>
> When file locking is enabled, everything works correctly and the
> right data gets passed, but the stub declarations in linux/fs.h
> did not get modified when the calling conventions changed in an
> earlier patch.
>
> Reported-by: kernel test robot <lkp@intel.com>
> Fixes: 7e2d8c29ecdd ("ARM: 9111/1: oabi-compat: rework fcntl64() emulation")
> Fixes: a75d30c77207 ("fs/locks: pass kernel struct flock to fcntl_getlk/setlk")
> Cc: Christoph Hellwig <hch@lst.de>
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>
> ---
Looks good. Thanks!
Acked-by: Christian Brauner <christian.brauner@ubuntu.com>
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2021-11-24 9:15 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-11-23 16:05 [PATCH] fs/locks: fix fcntl_getlk64/fcntl_setlk64 stub prototypes Arnd Bergmann
2021-11-23 16:07 ` Christoph Hellwig
2021-11-23 16:34 ` Jeff Layton
2021-11-24 9:15 ` Christian Brauner
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).