forked from mirrors/linux
fs/read_write: make default_llseek() killable
Allows killing processes that are waiting for the inode lock. Signed-off-by: Max Kellermann <max.kellermann@ionos.com> Link: https://lore.kernel.org/20250513150327.1373061-4-max.kellermann@ionos.com Signed-off-by: Christian Brauner <brauner@kernel.org>
This commit is contained in:
parent
d686875642
commit
2e1a8fbff5
1 changed files with 3 additions and 1 deletions
|
|
@ -332,7 +332,9 @@ loff_t default_llseek(struct file *file, loff_t offset, int whence)
|
||||||
struct inode *inode = file_inode(file);
|
struct inode *inode = file_inode(file);
|
||||||
loff_t retval;
|
loff_t retval;
|
||||||
|
|
||||||
inode_lock(inode);
|
retval = inode_lock_killable(inode);
|
||||||
|
if (retval)
|
||||||
|
return retval;
|
||||||
switch (whence) {
|
switch (whence) {
|
||||||
case SEEK_END:
|
case SEEK_END:
|
||||||
offset += i_size_read(inode);
|
offset += i_size_read(inode);
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue