提交 6cf671b2 编写于 作者: K Konstantin Komarov 提交者: Zheng Zengkai

fs/ntfs3: Refactor ntfs_read_mft

mainline inclusion
from mainline-v5.15
commit 22b05f1a
category: feature
bugzilla:
https://gitee.com/openeuler/kernel/issues/I4G67J?from=project-issue
CVE: NA

----------------------------------------------------------------------

Don't save size of attribute reparse point as size of symlink.
Signed-off-by: NKonstantin Komarov <almaz.alexandrovich@paragon-software.com>
Signed-off-by: NYin Xiujiang <yinxiujiang@kylinos.cn>
Signed-off-by: NZheng Zengkai <zhengzengkai@huawei.com>
Acked-by: NHou Tao <houtao1@huawei.com>
Acked-by: NXie XiuQi <xiexiuqi@huawei.com>
Signed-off-by: NZheng Zengkai <zhengzengkai@huawei.com>
上级 ba4ab5f2
无相关合并请求
......@@ -222,9 +222,6 @@ static struct inode *ntfs_read_mft(struct inode *inode,
if (!attr->non_res) {
ni->i_valid = inode->i_size = rsize;
inode_set_bytes(inode, rsize);
t32 = asize;
} else {
t32 = le16_to_cpu(attr->nres.run_off);
}
mode = S_IFREG | (0777 & sbi->options->fs_fmask_inv);
......@@ -313,17 +310,14 @@ static struct inode *ntfs_read_mft(struct inode *inode,
rp_fa = ni_parse_reparse(ni, attr, &rp);
switch (rp_fa) {
case REPARSE_LINK:
if (!attr->non_res) {
inode->i_size = rsize;
inode_set_bytes(inode, rsize);
t32 = asize;
} else {
inode->i_size =
le64_to_cpu(attr->nres.data_size);
t32 = le16_to_cpu(attr->nres.run_off);
}
/*
* Normal symlink.
* Assume one unicode symbol == one utf8.
*/
inode->i_size = le16_to_cpu(rp.SymbolicLinkReparseBuffer
.PrintNameLength) /
sizeof(u16);
/* Looks like normal symlink. */
ni->i_valid = inode->i_size;
/* Clear directory bit. */
......@@ -420,7 +414,7 @@ static struct inode *ntfs_read_mft(struct inode *inode,
ni->std_fa &= ~FILE_ATTRIBUTE_DIRECTORY;
inode->i_op = &ntfs_link_inode_operations;
inode->i_fop = NULL;
inode_nohighmem(inode); // ??
inode_nohighmem(inode);
} else if (S_ISREG(mode)) {
ni->std_fa &= ~FILE_ATTRIBUTE_DIRECTORY;
inode->i_op = &ntfs_file_inode_operations;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册
反馈
建议
客服 返回
顶部