summaryrefslogtreecommitdiffstats
path: root/fs/ntfs3/record.c
diff options
context:
space:
mode:
Diffstat (limited to 'fs/ntfs3/record.c')
-rw-r--r--fs/ntfs3/record.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/fs/ntfs3/record.c b/fs/ntfs3/record.c
index 6c76503edc..6aa3a9d44d 100644
--- a/fs/ntfs3/record.c
+++ b/fs/ntfs3/record.c
@@ -534,9 +534,16 @@ bool mi_remove_attr(struct ntfs_inode *ni, struct mft_inode *mi,
if (aoff + asize > used)
return false;
- if (ni && is_attr_indexed(attr) && attr->type == ATTR_NAME) {
+ if (ni && is_attr_indexed(attr)) {
u16 links = le16_to_cpu(ni->mi.mrec->hard_links);
- if (!links) {
+ struct ATTR_FILE_NAME *fname =
+ attr->type != ATTR_NAME ?
+ NULL :
+ resident_data_ex(attr,
+ SIZEOF_ATTRIBUTE_FILENAME);
+ if (fname && fname->type == FILE_NAME_DOS) {
+ /* Do not decrease links count deleting DOS name. */
+ } else if (!links) {
/* minor error. Not critical. */
} else {
ni->mi.mrec->hard_links = cpu_to_le16(links - 1);