diff options
author | Konstantin Komarov <almaz.alexandrovich@paragon-software.com> | 2022-05-12 11:25:48 +0200 |
---|---|---|
committer | Konstantin Komarov <almaz.alexandrovich@paragon-software.com> | 2022-06-06 17:38:57 +0200 |
commit | 19d1b7872d1ebf0658b5032b79f536a715303ee4 (patch) | |
tree | cc9f01560ecca700e571189a2d8839e019ed5076 /fs/ntfs3/record.c | |
parent | fs/ntfs3: Fix double free on remount (diff) | |
download | linux-19d1b7872d1ebf0658b5032b79f536a715303ee4.tar.xz linux-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.c | 5 |
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; } |