Skip to content

Commit 0ea9fc1

Browse files
arndbchucklever
authored andcommitted
fs/locks: fix fcntl_getlk64/fcntl_setlk64 stub prototypes
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 <[email protected]> Fixes: 7e2d8c2 ("ARM: 9111/1: oabi-compat: rework fcntl64() emulation") Fixes: a75d30c ("fs/locks: pass kernel struct flock to fcntl_getlk/setlk") Cc: Christoph Hellwig <[email protected]> Reviewed-by: Christoph Hellwig <[email protected]> Acked-by: Christian Brauner <[email protected]> Signed-off-by: Arnd Bergmann <[email protected]> Signed-off-by: Jeff Layton <[email protected]> Signed-off-by: Chuck Lever <[email protected]>
1 parent 074b07d commit 0ea9fc1

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

include/linux/fs.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1220,13 +1220,13 @@ static inline int fcntl_setlk(unsigned int fd, struct file *file,
12201220

12211221
#if BITS_PER_LONG == 32
12221222
static inline int fcntl_getlk64(struct file *file, unsigned int cmd,
1223-
struct flock64 __user *user)
1223+
struct flock64 *user)
12241224
{
12251225
return -EINVAL;
12261226
}
12271227

12281228
static inline int fcntl_setlk64(unsigned int fd, struct file *file,
1229-
unsigned int cmd, struct flock64 __user *user)
1229+
unsigned int cmd, struct flock64 *user)
12301230
{
12311231
return -EACCES;
12321232
}

0 commit comments

Comments
 (0)