mirror of
https://github.com/raspberrypi/linux.git
synced 2025-12-06 10:00:17 +00:00
fs/open: make do_truncate() 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-3-max.kellermann@ionos.com Signed-off-by: Christian Brauner <brauner@kernel.org>
This commit is contained in:
committed by
Christian Brauner
parent
28a3f6ab2f
commit
d686875642
@@ -60,7 +60,10 @@ int do_truncate(struct mnt_idmap *idmap, struct dentry *dentry,
|
||||
if (ret)
|
||||
newattrs.ia_valid |= ret | ATTR_FORCE;
|
||||
|
||||
inode_lock(dentry->d_inode);
|
||||
ret = inode_lock_killable(dentry->d_inode);
|
||||
if (ret)
|
||||
return ret;
|
||||
|
||||
/* Note any delegations or leases have already been broken: */
|
||||
ret = notify_change(idmap, dentry, &newattrs, NULL);
|
||||
inode_unlock(dentry->d_inode);
|
||||
|
||||
Reference in New Issue
Block a user