mirror of
https://github.com/torvalds/linux.git
synced 2025-12-07 20:06:24 +00:00
open: use super write guard in do_ftruncate()
Link: https://patch.msgid.link/20251104-work-guards-v1-7-5108ac78a171@kernel.org Reviewed-by: Jan Kara <jack@suse.cz> Signed-off-by: Christian Brauner <brauner@kernel.org>
This commit is contained in:
@@ -191,12 +191,9 @@ int do_ftruncate(struct file *file, loff_t length, int small)
|
||||
if (error)
|
||||
return error;
|
||||
|
||||
sb_start_write(inode->i_sb);
|
||||
error = do_truncate(file_mnt_idmap(file), dentry, length,
|
||||
ATTR_MTIME | ATTR_CTIME, file);
|
||||
sb_end_write(inode->i_sb);
|
||||
|
||||
return error;
|
||||
scoped_guard(super_write, inode->i_sb)
|
||||
return do_truncate(file_mnt_idmap(file), dentry, length,
|
||||
ATTR_MTIME | ATTR_CTIME, file);
|
||||
}
|
||||
|
||||
int do_sys_ftruncate(unsigned int fd, loff_t length, int small)
|
||||
|
||||
Reference in New Issue
Block a user