diff options
Diffstat (limited to 'fs/ext3/super.c')
| -rw-r--r-- | fs/ext3/super.c | 28 | 
1 files changed, 13 insertions, 15 deletions
diff --git a/fs/ext3/super.c b/fs/ext3/super.c index 8c892e93d8e..6e50223b329 100644 --- a/fs/ext3/super.c +++ b/fs/ext3/super.c @@ -532,6 +532,11 @@ static int init_inodecache(void)  static void destroy_inodecache(void)  { +	/* +	 * Make sure all delayed rcu free inodes are flushed before we +	 * destroy cache. +	 */ +	rcu_barrier();  	kmem_cache_destroy(ext3_inode_cachep);  } @@ -975,7 +980,7 @@ static int parse_options (char *options, struct super_block *sb,  		 * Initialize args struct so we know whether arg was  		 * found; some options take optional arguments.  		 */ -		args[0].to = args[0].from = 0; +		args[0].to = args[0].from = NULL;  		token = match_token(p, tokens, args);  		switch (token) {  		case Opt_bsd_df: @@ -996,7 +1001,7 @@ static int parse_options (char *options, struct super_block *sb,  			uid = make_kuid(current_user_ns(), option);  			if (!uid_valid(uid)) {  				ext3_msg(sb, KERN_ERR, "Invalid uid value %d", option); -				return -1; +				return 0;  			}  			sbi->s_resuid = uid; @@ -1007,7 +1012,7 @@ static int parse_options (char *options, struct super_block *sb,  			gid = make_kgid(current_user_ns(), option);  			if (!gid_valid(gid)) {  				ext3_msg(sb, KERN_ERR, "Invalid gid value %d", option); -				return -1; +				return 0;  			}  			sbi->s_resgid = gid;  			break; @@ -1479,10 +1484,12 @@ static void ext3_orphan_cleanup (struct super_block * sb,  	}  	if (EXT3_SB(sb)->s_mount_state & EXT3_ERROR_FS) { -		if (es->s_last_orphan) +		/* don't clear list on RO mount w/ errors */ +		if (es->s_last_orphan && !(s_flags & MS_RDONLY)) {  			jbd_debug(1, "Errors on filesystem, "  				  "clearing orphan list.\n"); -		es->s_last_orphan = 0; +			es->s_last_orphan = 0; +		}  		jbd_debug(1, "Skipping orphan recovery on fs with errors.\n");  		return;  	} @@ -1654,9 +1661,6 @@ static int ext3_fill_super (struct super_block *sb, void *data, int silent)  		return -ENOMEM;  	}  	sb->s_fs_info = sbi; -	sbi->s_mount_opt = 0; -	sbi->s_resuid = make_kuid(&init_user_ns, EXT3_DEF_RESUID); -	sbi->s_resgid = make_kgid(&init_user_ns, EXT3_DEF_RESGID);  	sbi->s_sb_block = sb_block;  	blocksize = sb_min_blocksize(sb, EXT3_MIN_BLOCK_SIZE); @@ -2571,11 +2575,9 @@ out:  static int ext3_unfreeze(struct super_block *sb)  {  	if (!(sb->s_flags & MS_RDONLY)) { -		lock_super(sb);  		/* Reser the needs_recovery flag before the fs is unlocked. */  		EXT3_SET_INCOMPAT_FEATURE(sb, EXT3_FEATURE_INCOMPAT_RECOVER);  		ext3_commit_super(sb, EXT3_SB(sb)->s_es, 1); -		unlock_super(sb);  		journal_unlock_updates(EXT3_SB(sb)->s_journal);  	}  	return 0; @@ -2595,7 +2597,6 @@ static int ext3_remount (struct super_block * sb, int * flags, char * data)  #endif  	/* Store the original options */ -	lock_super(sb);  	old_sb_flags = sb->s_flags;  	old_opts.s_mount_opt = sbi->s_mount_opt;  	old_opts.s_resuid = sbi->s_resuid; @@ -2701,8 +2702,6 @@ static int ext3_remount (struct super_block * sb, int * flags, char * data)  		    old_opts.s_qf_names[i] != sbi->s_qf_names[i])  			kfree(old_opts.s_qf_names[i]);  #endif -	unlock_super(sb); -  	if (enable_quota)  		dquot_resume(sb, -1);  	return 0; @@ -2721,7 +2720,6 @@ restore_opts:  		sbi->s_qf_names[i] = old_opts.s_qf_names[i];  	}  #endif -	unlock_super(sb);  	return err;  } @@ -2803,7 +2801,7 @@ static int ext3_statfs (struct dentry * dentry, struct kstatfs * buf)  static inline struct inode *dquot_to_inode(struct dquot *dquot)  { -	return sb_dqopt(dquot->dq_sb)->files[dquot->dq_type]; +	return sb_dqopt(dquot->dq_sb)->files[dquot->dq_id.type];  }  static int ext3_write_dquot(struct dquot *dquot)  |