summaryrefslogtreecommitdiffstats
path: root/fs/ntfs3/record.c
diff options
context:
space:
mode:
authorKonstantin Komarov <almaz.alexandrovich@paragon-software.com>2022-05-12 12:25:48 +0300
committerKonstantin Komarov <almaz.alexandrovich@paragon-software.com>2022-06-06 18:38:57 +0300
commit19d1b7872d1ebf0658b5032b79f536a715303ee4 (patch)
treecc9f01560ecca700e571189a2d8839e019ed5076 /fs/ntfs3/record.c
parentcd39981fb92adf0cc736112f87e3e61602baa415 (diff)
downloadlinux-stable-19d1b7872d1ebf0658b5032b79f536a715303ee4.tar.gz
linux-stable-19d1b7872d1ebf0658b5032b79f536a715303ee4.tar.bz2
linux-stable-19d1b7872d1ebf0658b5032b79f536a715303ee4.zip
fs/ntfs3: Refactor ni_try_remove_attr_list function
Now we save a copy of primary record for restoration. Also now we remove all attributes from subrecords. Signed-off-by: Konstantin Komarov <almaz.alexandrovich@paragon-software.com>
Diffstat (limited to 'fs/ntfs3/record.c')
-rw-r--r--fs/ntfs3/record.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/fs/ntfs3/record.c b/fs/ntfs3/record.c
index 861e35791506..8fe0a876400a 100644
--- a/fs/ntfs3/record.c
+++ b/fs/ntfs3/record.c
@@ -445,12 +445,11 @@ struct ATTRIB *mi_insert_attr(struct mft_inode *mi, enum ATTR_TYPE type,
attr = NULL;
while ((attr = mi_enum_attr(mi, attr))) {
diff = compare_attr(attr, type, name, name_len, upcase);
- if (diff > 0)
- break;
+
if (diff < 0)
continue;
- if (!is_attr_indexed(attr))
+ if (!diff && !is_attr_indexed(attr))
return NULL;
break;
}