aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--fs/ntfs/ChangeLog2
-rw-r--r--fs/ntfs/aops.c1
-rw-r--r--fs/ntfs/attrib.c6
-rw-r--r--fs/ntfs/file.c13
-rw-r--r--fs/ntfs/mft.c1
-rw-r--r--fs/ntfs/mft.h5
6 files changed, 5 insertions, 23 deletions
diff --git a/fs/ntfs/ChangeLog b/fs/ntfs/ChangeLog
index b5774233ef1d..13e70d4e2fdb 100644
--- a/fs/ntfs/ChangeLog
+++ b/fs/ntfs/ChangeLog
@@ -32,6 +32,8 @@ ToDo/Notes:
32 unused, invalid mft records which are the same in both $MFT and 32 unused, invalid mft records which are the same in both $MFT and
33 $MFTMirr. 33 $MFTMirr.
34 - Add support for sparse files which have a compression unit of 0. 34 - Add support for sparse files which have a compression unit of 0.
35 - Remove all the make_bad_inode() calls. This should only be called
36 from read inode and new inode code paths.
35 37
362.1.26 - Minor bug fixes and updates. 382.1.26 - Minor bug fixes and updates.
37 39
diff --git a/fs/ntfs/aops.c b/fs/ntfs/aops.c
index 7c7e313620fa..1cf105b99202 100644
--- a/fs/ntfs/aops.c
+++ b/fs/ntfs/aops.c
@@ -1530,7 +1530,6 @@ err_out:
1530 "error %i.", err); 1530 "error %i.", err);
1531 SetPageError(page); 1531 SetPageError(page);
1532 NVolSetErrors(ni->vol); 1532 NVolSetErrors(ni->vol);
1533 make_bad_inode(vi);
1534 } 1533 }
1535 unlock_page(page); 1534 unlock_page(page);
1536 if (ctx) 1535 if (ctx)
diff --git a/fs/ntfs/attrib.c b/fs/ntfs/attrib.c
index 7a568eb7d80f..1663f5c3c6aa 100644
--- a/fs/ntfs/attrib.c
+++ b/fs/ntfs/attrib.c
@@ -2438,16 +2438,12 @@ undo_alloc:
2438 "chkdsk to recover.", IS_ERR(m) ? 2438 "chkdsk to recover.", IS_ERR(m) ?
2439 "restore attribute search context" : 2439 "restore attribute search context" :
2440 "truncate attribute runlist"); 2440 "truncate attribute runlist");
2441 make_bad_inode(vi);
2442 make_bad_inode(VFS_I(base_ni));
2443 NVolSetErrors(vol); 2441 NVolSetErrors(vol);
2444 } else if (mp_rebuilt) { 2442 } else if (mp_rebuilt) {
2445 if (ntfs_attr_record_resize(m, a, attr_len)) { 2443 if (ntfs_attr_record_resize(m, a, attr_len)) {
2446 ntfs_error(vol->sb, "Failed to restore attribute " 2444 ntfs_error(vol->sb, "Failed to restore attribute "
2447 "record in error code path. Run " 2445 "record in error code path. Run "
2448 "chkdsk to recover."); 2446 "chkdsk to recover.");
2449 make_bad_inode(vi);
2450 make_bad_inode(VFS_I(base_ni));
2451 NVolSetErrors(vol); 2447 NVolSetErrors(vol);
2452 } else /* if (success) */ { 2448 } else /* if (success) */ {
2453 if (ntfs_mapping_pairs_build(vol, (u8*)a + le16_to_cpu( 2449 if (ntfs_mapping_pairs_build(vol, (u8*)a + le16_to_cpu(
@@ -2460,8 +2456,6 @@ undo_alloc:
2460 "mapping pairs array in error " 2456 "mapping pairs array in error "
2461 "code path. Run chkdsk to " 2457 "code path. Run chkdsk to "
2462 "recover."); 2458 "recover.");
2463 make_bad_inode(vi);
2464 make_bad_inode(VFS_I(base_ni));
2465 NVolSetErrors(vol); 2459 NVolSetErrors(vol);
2466 } 2460 }
2467 flush_dcache_mft_record_page(ctx->ntfs_ino); 2461 flush_dcache_mft_record_page(ctx->ntfs_ino);
diff --git a/fs/ntfs/file.c b/fs/ntfs/file.c
index 2e5ba0c535d9..f5d057e4acc2 100644
--- a/fs/ntfs/file.c
+++ b/fs/ntfs/file.c
@@ -1207,8 +1207,6 @@ rl_not_mapped_enoent:
1207 "attribute runlist in error code " 1207 "attribute runlist in error code "
1208 "path. Run chkdsk to recover the " 1208 "path. Run chkdsk to recover the "
1209 "lost cluster."); 1209 "lost cluster.");
1210 make_bad_inode(vi);
1211 make_bad_inode(VFS_I(base_ni));
1212 NVolSetErrors(vol); 1210 NVolSetErrors(vol);
1213 } else /* if (success) */ { 1211 } else /* if (success) */ {
1214 status.runlist_merged = 0; 1212 status.runlist_merged = 0;
@@ -1239,8 +1237,6 @@ rl_not_mapped_enoent:
1239 ntfs_error(vol->sb, "Failed to restore attribute " 1237 ntfs_error(vol->sb, "Failed to restore attribute "
1240 "record in error code path. Run " 1238 "record in error code path. Run "
1241 "chkdsk to recover."); 1239 "chkdsk to recover.");
1242 make_bad_inode(vi);
1243 make_bad_inode(VFS_I(base_ni));
1244 NVolSetErrors(vol); 1240 NVolSetErrors(vol);
1245 } else /* if (success) */ { 1241 } else /* if (success) */ {
1246 if (ntfs_mapping_pairs_build(vol, (u8*)a + 1242 if (ntfs_mapping_pairs_build(vol, (u8*)a +
@@ -1253,8 +1249,6 @@ rl_not_mapped_enoent:
1253 "mapping pairs array in error " 1249 "mapping pairs array in error "
1254 "code path. Run chkdsk to " 1250 "code path. Run chkdsk to "
1255 "recover."); 1251 "recover.");
1256 make_bad_inode(vi);
1257 make_bad_inode(VFS_I(base_ni));
1258 NVolSetErrors(vol); 1252 NVolSetErrors(vol);
1259 } 1253 }
1260 flush_dcache_mft_record_page(ctx->ntfs_ino); 1254 flush_dcache_mft_record_page(ctx->ntfs_ino);
@@ -1623,11 +1617,8 @@ err_out:
1623 unmap_mft_record(base_ni); 1617 unmap_mft_record(base_ni);
1624 ntfs_error(vi->i_sb, "Failed to update initialized_size/i_size (error " 1618 ntfs_error(vi->i_sb, "Failed to update initialized_size/i_size (error "
1625 "code %i).", err); 1619 "code %i).", err);
1626 if (err != -ENOMEM) { 1620 if (err != -ENOMEM)
1627 NVolSetErrors(ni->vol); 1621 NVolSetErrors(ni->vol);
1628 make_bad_inode(VFS_I(base_ni));
1629 make_bad_inode(vi);
1630 }
1631 return err; 1622 return err;
1632} 1623}
1633 1624
@@ -1802,8 +1793,6 @@ err_out:
1802 ntfs_error(vi->i_sb, "Resident attribute commit write failed " 1793 ntfs_error(vi->i_sb, "Resident attribute commit write failed "
1803 "with error %i.", err); 1794 "with error %i.", err);
1804 NVolSetErrors(ni->vol); 1795 NVolSetErrors(ni->vol);
1805 make_bad_inode(VFS_I(base_ni));
1806 make_bad_inode(vi);
1807 } 1796 }
1808 if (ctx) 1797 if (ctx)
1809 ntfs_attr_put_search_ctx(ctx); 1798 ntfs_attr_put_search_ctx(ctx);
diff --git a/fs/ntfs/mft.c b/fs/ntfs/mft.c
index 6499aafc2258..7254391b0e50 100644
--- a/fs/ntfs/mft.c
+++ b/fs/ntfs/mft.c
@@ -93,6 +93,7 @@ static inline MFT_RECORD *map_mft_record_page(ntfs_inode *ni)
93 "Run chkdsk.", ni->mft_no); 93 "Run chkdsk.", ni->mft_no);
94 ntfs_unmap_page(page); 94 ntfs_unmap_page(page);
95 page = ERR_PTR(-EIO); 95 page = ERR_PTR(-EIO);
96 NVolSetErrors(vol);
96 } 97 }
97err_out: 98err_out:
98 ni->page = NULL; 99 ni->page = NULL;
diff --git a/fs/ntfs/mft.h b/fs/ntfs/mft.h
index 407de2cef1d6..639cd1bab08b 100644
--- a/fs/ntfs/mft.h
+++ b/fs/ntfs/mft.h
@@ -97,10 +97,7 @@ extern int write_mft_record_nolock(ntfs_inode *ni, MFT_RECORD *m, int sync);
97 * uptodate. 97 * uptodate.
98 * 98 *
99 * On success, clean the mft record and return 0. On error, leave the mft 99 * On success, clean the mft record and return 0. On error, leave the mft
100 * record dirty and return -errno. The caller should call make_bad_inode() on 100 * record dirty and return -errno.
101 * the base inode to ensure no more access happens to this inode. We do not do
102 * it here as the caller may want to finish writing other extent mft records
103 * first to minimize on-disk metadata inconsistencies.
104 */ 101 */
105static inline int write_mft_record(ntfs_inode *ni, MFT_RECORD *m, int sync) 102static inline int write_mft_record(ntfs_inode *ni, MFT_RECORD *m, int sync)
106{ 103{