提交 c82e42da 编写于 作者: M Miklos Szeredi 提交者: Al Viro

[patch 1/5] vfs: truncate: dont check immutable twice

vfs_permission(MAY_WRITE) already checked for the inode being
immutable, so no need to repeat it.
Signed-off-by: NMiklos Szeredi <mszeredi@suse.cz>
Acked-by: NChristoph Hellwig <hch@infradead.org>
上级 e6305c43
......@@ -256,7 +256,7 @@ static long do_sys_truncate(const char __user * path, loff_t length)
goto mnt_drop_write_and_out;
error = -EPERM;
if (IS_IMMUTABLE(inode) || IS_APPEND(inode))
if (IS_APPEND(inode))
goto mnt_drop_write_and_out;
error = get_write_access(inode);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册