提交 4071b913 编写于 作者: J Jan Kara

udf: Properly detect stale inodes

NFS can easily ask for inodes that are already deleted. Currently UDF
happily returns such inodes which is a bug. Return -ESTALE if
udf_read_inode() is asked to read deleted inode.
Signed-off-by: NJan Kara <jack@suse.cz>
上级 6d3d5e86
......@@ -1435,8 +1435,10 @@ static int udf_read_inode(struct inode *inode)
read_unlock(&sbi->s_cred_lock);
link_count = le16_to_cpu(fe->fileLinkCount);
if (!link_count)
link_count = 1;
if (!link_count) {
ret = -ESTALE;
goto out;
}
set_nlink(inode, link_count);
inode->i_size = le64_to_cpu(fe->informationLength);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册