ntfs: check for index entry which has INDEX_ENTRY_END flag set
authorPaulo Alcantara <pcacjr@gmail.com>
Sun, 12 Feb 2012 02:14:54 +0000 (23:14 -0300)
committerPaulo Alcantara <pcacjr@gmail.com>
Sun, 12 Feb 2012 02:14:54 +0000 (23:14 -0300)
In ntfs_readdir(), if one entry has INDEX_ENTRY_END flag set, it won't
contain indexed_file member, that'd be used afterwards when looking for
the MFT record that is associated with that index entry.

Signed-off-by: Paulo Alcantara <pcacjr@gmail.com>
core/fs/ntfs/ntfs.c
core/fs/ntfs/ntfs.h

index 0f6cc44..500d0fd 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2011 Paulo Alcantara <pcacjr@gmail.com>
+ * Copyright (C) 2011-2012 Paulo Alcantara <pcacjr@gmail.com>
  *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
@@ -1181,6 +1181,14 @@ idx_block_next_entry:
     }
 
     readdir_state->entries_count++;
+
+    /* Need to check if this entry has INDEX_ENTRY_END flag set. If
+     * so, then it won't contain a indexed_file file, so continue the
+     * lookup on the next VCN/LCN (if any).
+     */
+    if (ie->flags & INDEX_ENTRY_END)
+        goto next_vcn;
+
     len = ntfs_cvt_filename(filename, ie);
     if (!is_filename_printable(filename))
         goto idx_block_next_entry;
index c6aa074..721a78d 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2011 Paulo Alcantara <pcacjr@gmail.com>
+ * Copyright (C) 2011-2012 Paulo Alcantara <pcacjr@gmail.com>
  *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by