attr_make_nonresident() takes new_size but never uses it: the attribute's size is read from the record it is converting, and all three callers pass either the value already stored there or, in attr_set_size_res(), a size that the function ignores. Remove the argument. Signed-off-by: Konstantin Komarov --- fs/ntfs3/attrib.c | 13 ++++++------- fs/ntfs3/frecord.c | 5 ++--- fs/ntfs3/ntfs_fs.h | 4 ++-- 3 files changed, 10 insertions(+), 12 deletions(-) diff --git a/fs/ntfs3/attrib.c b/fs/ntfs3/attrib.c index cd6d4b75d328..254037763a86 100644 --- a/fs/ntfs3/attrib.c +++ b/fs/ntfs3/attrib.c @@ -258,8 +258,8 @@ int attr_allocate_clusters(struct ntfs_sb_info *sbi, struct runs_tree *run, */ int attr_make_nonresident(struct ntfs_inode *ni, struct ATTRIB *attr, struct ATTR_LIST_ENTRY *le, struct mft_inode *mi, - u64 new_size, struct runs_tree *run, - struct ATTRIB **ins_attr, struct page *page) + struct runs_tree *run, struct ATTRIB **ins_attr, + struct page *page) { struct ntfs_sb_info *sbi; struct ATTRIB *attr_s; @@ -401,8 +401,8 @@ static int attr_set_size_res(struct ntfs_inode *ni, struct ATTRIB *attr, if (new_size > sbi->record_size || (dsize > 0 && used + dsize > sbi->max_bytes_per_attr)) { - return attr_make_nonresident(ni, attr, le, mi, new_size, run, - ins_attr, NULL); + return attr_make_nonresident(ni, attr, le, mi, run, ins_attr, + NULL); } if (dsize < 0) { @@ -2832,9 +2832,8 @@ int attr_force_nonresident(struct ntfs_inode *ni) } down_write(&ni->file.run_lock); - err = attr_make_nonresident(ni, attr, le, mi, - le32_to_cpu(attr->res.data_size), - &ni->file.run, &attr, NULL); + err = attr_make_nonresident(ni, attr, le, mi, &ni->file.run, &attr, + NULL); up_write(&ni->file.run_lock); return err; diff --git a/fs/ntfs3/frecord.c b/fs/ntfs3/frecord.c index fc4ddbcf844f..1e3f78b77a48 100644 --- a/fs/ntfs3/frecord.c +++ b/fs/ntfs3/frecord.c @@ -2573,9 +2573,8 @@ int ni_write_frame(struct ntfs_inode *ni, struct page **pages, if (!attr->non_res) { down_write(&ni->file.run_lock); - err = attr_make_nonresident(ni, attr, le, mi, - le32_to_cpu(attr->res.data_size), - &ni->file.run, &attr, pages[0]); + err = attr_make_nonresident(ni, attr, le, mi, &ni->file.run, + &attr, pages[0]); up_write(&ni->file.run_lock); if (err) goto out; diff --git a/fs/ntfs3/ntfs_fs.h b/fs/ntfs3/ntfs_fs.h index 5811d89d67b3..9321b2608e84 100644 --- a/fs/ntfs3/ntfs_fs.h +++ b/fs/ntfs3/ntfs_fs.h @@ -464,8 +464,8 @@ int attr_allocate_clusters(struct ntfs_sb_info *sbi, struct runs_tree *run, CLST *new_len); int attr_make_nonresident(struct ntfs_inode *ni, struct ATTRIB *attr, struct ATTR_LIST_ENTRY *le, struct mft_inode *mi, - u64 new_size, struct runs_tree *run, - struct ATTRIB **ins_attr, struct page *page); + struct runs_tree *run, struct ATTRIB **ins_attr, + struct page *page); int attr_set_size_ex(struct ntfs_inode *ni, enum ATTR_TYPE type, const __le16 *name, u8 name_len, struct runs_tree *run, u64 new_size, const u64 *new_valid, bool keep_prealloc, -- 2.43.0