Changes by: antona
Update of /cvsroot/linux-ntfs/linux-ntfs/libntfs
In directory usw-pr-cvs1:/tmp/cvs-serv3652/libntfs
Modified Files:
inode.c mft.c
Log Message:
Change ntfs_read_file_record() not to abort if the inode is not in use. Adapt callers which care to check this themselves.
Index: inode.c
===================================================================
RCS file: /cvsroot/linux-ntfs/linux-ntfs/libntfs/inode.c,v
retrieving revision 1.10
retrieving revision 1.11
diff -U2 -r1.10 -r1.11
--- inode.c 2 Jul 2002 23:47:10 -0000 1.10
+++ inode.c 7 Jul 2002 19:44:57 -0000 1.11
@@ -103,4 +103,6 @@
if (ntfs_read_file_record(vol, mref, &ni->mrec, NULL))
goto err_out;
+ if (!(ni->mrec->flags & MFT_RECORD_IN_USE))
+ goto err_out;
ni->mft_no = MREF(mref);
ctx = ntfs_get_attr_search_ctx(ni, NULL);
Index: mft.c
===================================================================
RCS file: /cvsroot/linux-ntfs/linux-ntfs/libntfs/mft.c,v
retrieving revision 1.29
retrieving revision 1.30
diff -U2 -r1.29 -r1.30
--- mft.c 2 Jul 2002 23:47:10 -0000 1.29
+++ mft.c 7 Jul 2002 19:44:57 -0000 1.30
@@ -181,5 +181,5 @@
* Return 0 on success, or -1 on error, with errno set to the error code.
*
- * The read mft record is checked for having the magic FILE, for being in use,
+ * The read mft record is checked for having the magic FILE,
* and for having a matching sequence number (if MSEQNO(*@mref) != 0).
* If either of these fails, -1 is returned and errno is set to EIO. If you get
@@ -188,4 +188,7 @@
*
* Note: Caller has to free *@mrec when finished.
+ *
+ * Note: We do not check if the mft record is flagged in use. The caller can
+ * check if desired.
*/
int ntfs_read_file_record(const ntfs_volume *vol, const MFT_REF mref,
@@ -213,6 +216,4 @@
goto file_corrupt;
if (MSEQNO(mref) && MSEQNO(mref) != le16_to_cpu(m->sequence_number))
- goto file_corrupt;
- if (!(m->flags & MFT_RECORD_IN_USE))
goto file_corrupt;
a = (ATTR_RECORD*)((char*)m + le16_to_cpu(m->attrs_offset));
|