From dc67fccdbe146f0b1095f7d5b164bd09ceb9efbf Mon Sep 17 00:00:00 2001 From: Greg Kroah-Hartman Date: Mon, 12 Aug 2024 13:07:34 +0000 Subject: [PATCH] ANDROID: properly backport filelock fix in 5.10.223 In commit 5661b9c7ec18 ("filelock: Remove locks reliably when fcntl/close race is detected"), upstream the current change was not present, but it is in our branch due to external changes, so fix it up to build and work properly here. Fixes: 5661b9c7ec18 ("filelock: Remove locks reliably when fcntl/close race is detected") Change-Id: I0ac2c1ab80cfb9f9577d09dbee45d3eb2ac19612 Signed-off-by: Greg Kroah-Hartman --- fs/locks.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/fs/locks.c b/fs/locks.c index 83145d4639a1..425ef3951153 100644 --- a/fs/locks.c +++ b/fs/locks.c @@ -2546,7 +2546,7 @@ int fcntl_setlk(unsigned int fd, struct file *filp, unsigned int cmd, f = fcheck(fd); spin_unlock(¤t->files->file_lock); if (f != filp) { - locks_remove_posix(filp, files); + locks_remove_posix(filp, ¤t->files); error = -EBADF; } } @@ -2676,7 +2676,7 @@ int fcntl_setlk64(unsigned int fd, struct file *filp, unsigned int cmd, f = fcheck(fd); spin_unlock(¤t->files->file_lock); if (f != filp) { - locks_remove_posix(filp, files); + locks_remove_posix(filp, ¤t->files); error = -EBADF; } }