ANDROID: properly backport filelock fix in 5.10.223

In commit 5661b9c7ec ("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: 5661b9c7ec ("filelock: Remove locks reliably when fcntl/close race is detected")
Change-Id: I0ac2c1ab80cfb9f9577d09dbee45d3eb2ac19612
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
This commit is contained in:
Greg Kroah-Hartman 2024-08-12 13:07:34 +00:00
parent 72f4574b8d
commit dc67fccdbe

View File

@ -2546,7 +2546,7 @@ int fcntl_setlk(unsigned int fd, struct file *filp, unsigned int cmd,
f = fcheck(fd);
spin_unlock(&current->files->file_lock);
if (f != filp) {
locks_remove_posix(filp, files);
locks_remove_posix(filp, &current->files);
error = -EBADF;
}
}
@ -2676,7 +2676,7 @@ int fcntl_setlk64(unsigned int fd, struct file *filp, unsigned int cmd,
f = fcheck(fd);
spin_unlock(&current->files->file_lock);
if (f != filp) {
locks_remove_posix(filp, files);
locks_remove_posix(filp, &current->files);
error = -EBADF;
}
}