Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 337eb00a authored by Alessio Igor Bogani's avatar Alessio Igor Bogani Committed by Al Viro
Browse files

Push BKL down into ->remount_fs()



[xfs, btrfs, capifs, shmem don't need BKL, exempt]

Signed-off-by: default avatarAlessio Igor Bogani <abogani@texware.it>
Signed-off-by: default avatarAl Viro <viro@zeniv.linux.org.uk>
parent 4195f73d
Loading
Loading
Loading
Loading
+5 −0
Original line number Diff line number Diff line
@@ -39,6 +39,7 @@
#include <linux/parser.h>
#include <linux/notifier.h>
#include <linux/seq_file.h>
#include <linux/smp_lock.h>
#include <asm/byteorder.h>
#include "usb.h"
#include "hcd.h"
@@ -265,9 +266,13 @@ static int remount(struct super_block *sb, int *flags, char *data)
		return -EINVAL;
	}

	lock_kernel();

	if (usbfs_mount && usbfs_mount->mnt_sb)
		update_sb(usbfs_mount->mnt_sb);

	unlock_kernel();

	return 0;
}

+6 −1
Original line number Diff line number Diff line
@@ -16,6 +16,7 @@
#include <linux/parser.h>
#include <linux/magic.h>
#include <linux/sched.h>
#include <linux/smp_lock.h>
#include "affs.h"

extern struct timezone sys_tz;
@@ -512,6 +513,7 @@ affs_remount(struct super_block *sb, int *flags, char *data)
		kfree(new_opts);
		return -EINVAL;
	}
	lock_kernel();
	replace_mount_options(sb, new_opts);

	sbi->s_flags = mount_flags;
@@ -519,8 +521,10 @@ affs_remount(struct super_block *sb, int *flags, char *data)
	sbi->s_uid   = uid;
	sbi->s_gid   = gid;

	if ((*flags & MS_RDONLY) == (sb->s_flags & MS_RDONLY))
	if ((*flags & MS_RDONLY) == (sb->s_flags & MS_RDONLY)) {
		unlock_kernel();
		return 0;
	}
	if (*flags & MS_RDONLY) {
		sb->s_dirt = 1;
		while (sb->s_dirt)
@@ -529,6 +533,7 @@ affs_remount(struct super_block *sb, int *flags, char *data)
	} else
		res = affs_init_bitmap(sb, flags);

	unlock_kernel();
	return res;
}

+10 −2
Original line number Diff line number Diff line
@@ -1162,6 +1162,8 @@ static int ext2_remount (struct super_block * sb, int * flags, char * data)
	unsigned long old_sb_flags;
	int err;

	lock_kernel();

	/* Store the old options */
	old_sb_flags = sb->s_flags;
	old_opts.s_mount_opt = sbi->s_mount_opt;
@@ -1197,12 +1199,16 @@ static int ext2_remount (struct super_block * sb, int * flags, char * data)
		sbi->s_mount_opt &= ~EXT2_MOUNT_XIP;
		sbi->s_mount_opt |= old_mount_opt & EXT2_MOUNT_XIP;
	}
	if ((*flags & MS_RDONLY) == (sb->s_flags & MS_RDONLY))
	if ((*flags & MS_RDONLY) == (sb->s_flags & MS_RDONLY)) {
		unlock_kernel();
		return 0;
	}
	if (*flags & MS_RDONLY) {
		if (le16_to_cpu(es->s_state) & EXT2_VALID_FS ||
		    !(sbi->s_mount_state & EXT2_VALID_FS))
		    !(sbi->s_mount_state & EXT2_VALID_FS)) {
			unlock_kernel();
			return 0;
		}
		/*
		 * OK, we are remounting a valid rw partition rdonly, so set
		 * the rdonly flag and then mark the partition as valid again.
@@ -1229,12 +1235,14 @@ static int ext2_remount (struct super_block * sb, int * flags, char * data)
			sb->s_flags &= ~MS_RDONLY;
	}
	ext2_sync_super(sb, es);
	unlock_kernel();
	return 0;
restore_opts:
	sbi->s_mount_opt = old_opts.s_mount_opt;
	sbi->s_resuid = old_opts.s_resuid;
	sbi->s_resgid = old_opts.s_resgid;
	sb->s_flags = old_sb_flags;
	unlock_kernel();
	return err;
}

+4 −0
Original line number Diff line number Diff line
@@ -2490,6 +2490,8 @@ static int ext3_remount (struct super_block * sb, int * flags, char * data)
	int i;
#endif

	lock_kernel();

	/* Store the original options */
	lock_super(sb);
	old_sb_flags = sb->s_flags;
@@ -2600,6 +2602,7 @@ static int ext3_remount (struct super_block * sb, int * flags, char * data)
			kfree(old_opts.s_qf_names[i]);
#endif
	unlock_super(sb);
	unlock_kernel();
	return 0;
restore_opts:
	sb->s_flags = old_sb_flags;
@@ -2617,6 +2620,7 @@ static int ext3_remount (struct super_block * sb, int * flags, char * data)
	}
#endif
	unlock_super(sb);
	unlock_kernel();
	return err;
}

+4 −0
Original line number Diff line number Diff line
@@ -3422,6 +3422,8 @@ static int ext4_remount(struct super_block *sb, int *flags, char *data)
	int i;
#endif

	lock_kernel();

	/* Store the original options */
	lock_super(sb);
	old_sb_flags = sb->s_flags;
@@ -3558,6 +3560,7 @@ static int ext4_remount(struct super_block *sb, int *flags, char *data)
			kfree(old_opts.s_qf_names[i]);
#endif
	unlock_super(sb);
	unlock_kernel();
	return 0;

restore_opts:
@@ -3578,6 +3581,7 @@ static int ext4_remount(struct super_block *sb, int *flags, char *data)
	}
#endif
	unlock_super(sb);
	unlock_kernel();
	return err;
}

Loading