aboutsummaryrefslogtreecommitdiffstats
path: root/fs/ntfs/inode.c
diff options
context:
space:
mode:
authorAnton Altaparmakov <aia21@cantab.net>2006-03-23 11:18:23 -0500
committerAnton Altaparmakov <aia21@cantab.net>2006-03-23 11:18:23 -0500
commita778f217328a7391e0919b6463ec7f143851d12d (patch)
tree2f6837d70e52d9c3a46678c1efb975cd61a5dcf0 /fs/ntfs/inode.c
parent2c2c8c1c211c75d0cc9d7642a569ceac1aecd96d (diff)
NTFS: Fix a bug in fs/ntfs/inode.c::ntfs_read_locked_index_inode() where we
forgot to update a temporary variable so loading index inodes which have an index allocation attribute failed. Signed-off-by: Anton Altaparmakov <aia21@cantab.net>
Diffstat (limited to 'fs/ntfs/inode.c')
-rw-r--r--fs/ntfs/inode.c26
1 files changed, 11 insertions, 15 deletions
diff --git a/fs/ntfs/inode.c b/fs/ntfs/inode.c
index ae341922f423..5f4b23d213b9 100644
--- a/fs/ntfs/inode.c
+++ b/fs/ntfs/inode.c
@@ -19,15 +19,19 @@
19 * Foundation,Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 19 * Foundation,Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
20 */ 20 */
21 21
22#include <linux/pagemap.h>
23#include <linux/buffer_head.h> 22#include <linux/buffer_head.h>
24#include <linux/smp_lock.h> 23#include <linux/fs.h>
25#include <linux/quotaops.h> 24#include <linux/mm.h>
26#include <linux/mount.h> 25#include <linux/mount.h>
27#include <linux/mutex.h> 26#include <linux/mutex.h>
27#include <linux/pagemap.h>
28#include <linux/quotaops.h>
29#include <linux/slab.h>
30#include <linux/smp_lock.h>
28 31
29#include "aops.h" 32#include "aops.h"
30#include "attrib.h" 33#include "attrib.h"
34#include "bitmap.h"
31#include "dir.h" 35#include "dir.h"
32#include "debug.h" 36#include "debug.h"
33#include "inode.h" 37#include "inode.h"
@@ -1428,7 +1432,6 @@ err_out:
1428 "Run chkdsk.", err, vi->i_ino, ni->type, ni->name_len, 1432 "Run chkdsk.", err, vi->i_ino, ni->type, ni->name_len,
1429 base_vi->i_ino); 1433 base_vi->i_ino);
1430 make_bad_inode(vi); 1434 make_bad_inode(vi);
1431 make_bad_inode(base_vi);
1432 if (err != -ENOMEM) 1435 if (err != -ENOMEM)
1433 NVolSetErrors(vol); 1436 NVolSetErrors(vol);
1434 return err; 1437 return err;
@@ -1613,6 +1616,7 @@ static int ntfs_read_locked_index_inode(struct inode *base_vi, struct inode *vi)
1613 "$INDEX_ALLOCATION attribute."); 1616 "$INDEX_ALLOCATION attribute.");
1614 goto unm_err_out; 1617 goto unm_err_out;
1615 } 1618 }
1619 a = ctx->attr;
1616 if (!a->non_resident) { 1620 if (!a->non_resident) {
1617 ntfs_error(vi->i_sb, "$INDEX_ALLOCATION attribute is " 1621 ntfs_error(vi->i_sb, "$INDEX_ALLOCATION attribute is "
1618 "resident."); 1622 "resident.");
@@ -2845,11 +2849,8 @@ done:
2845old_bad_out: 2849old_bad_out:
2846 old_size = -1; 2850 old_size = -1;
2847bad_out: 2851bad_out:
2848 if (err != -ENOMEM && err != -EOPNOTSUPP) { 2852 if (err != -ENOMEM && err != -EOPNOTSUPP)
2849 make_bad_inode(vi);
2850 make_bad_inode(VFS_I(base_ni));
2851 NVolSetErrors(vol); 2853 NVolSetErrors(vol);
2852 }
2853 if (err != -EOPNOTSUPP) 2854 if (err != -EOPNOTSUPP)
2854 NInoSetTruncateFailed(ni); 2855 NInoSetTruncateFailed(ni);
2855 else if (old_size >= 0) 2856 else if (old_size >= 0)
@@ -2864,11 +2865,8 @@ out:
2864 ntfs_debug("Failed. Returning error code %i.", err); 2865 ntfs_debug("Failed. Returning error code %i.", err);
2865 return err; 2866 return err;
2866conv_err_out: 2867conv_err_out:
2867 if (err != -ENOMEM && err != -EOPNOTSUPP) { 2868 if (err != -ENOMEM && err != -EOPNOTSUPP)
2868 make_bad_inode(vi);
2869 make_bad_inode(VFS_I(base_ni));
2870 NVolSetErrors(vol); 2869 NVolSetErrors(vol);
2871 }
2872 if (err != -EOPNOTSUPP) 2870 if (err != -EOPNOTSUPP)
2873 NInoSetTruncateFailed(ni); 2871 NInoSetTruncateFailed(ni);
2874 else 2872 else
@@ -3116,9 +3114,7 @@ err_out:
3116 "retries later."); 3114 "retries later.");
3117 mark_inode_dirty(vi); 3115 mark_inode_dirty(vi);
3118 } else { 3116 } else {
3119 ntfs_error(vi->i_sb, "Failed (error code %i): Marking inode " 3117 ntfs_error(vi->i_sb, "Failed (error %i): Run chkdsk.", -err);
3120 "as bad. You should run chkdsk.", -err);
3121 make_bad_inode(vi);
3122 NVolSetErrors(ni->vol); 3118 NVolSetErrors(ni->vol);
3123 } 3119 }
3124 return err; 3120 return err;