Push BKL down into ->remount_fs() v2
Subsystems (18)
PATCH 1/1 Push BKL down into ->remount_fs() v2
Push the BKL acquisition from vfs to every specific filesystems with hope that it can be eliminated in a second moment.
Changes from previous version:
Removed useless BKL from some filesystems which don't require it.
Reduced BKL acquisition as short as possible.
Signed-off-by Alessio Igor Bogani <[email protected]>
PATCH 1/1 Push BKL down into ->remount_fs()
Signed-off-by Alessio Igor Bogani <[email protected]>
--- drivers/isdn/capi/capifs.c | 4 ++++ drivers/usb/core/inode.c | 5 +++++ fs/affs/super.c | 7 ++++++- fs/btrfs/super.c | 10 ++++++++-- fs/ext2/super.c | 12 ++++++++++-- fs/ext3/super.c | 4 ++++ fs/ext4/super.c | 4 ++++ fs/hpfs/super.c | 4 ++++ fs/jffs2/fs.c | 3 +++ fs/jfs/super.c | 22 ++++++++++++++++++---- fs/nfs/super.c | 2 ++ fs/nilfs2/super.c | 4 ++++ fs/ntfs/super.c | 15 ++++++++++++++- fs/ocfs2/super.c | 4 ++++ fs/reiserfs/super.c | 4 ++++ fs/super.c | 2 -- fs/ubifs/super.c | 9 ++++++++- fs/udf/super.c | 6 +++++- fs/ufs/super.c | 11 ++++++++++- fs/xfs/linux-2.6/xfs_super.c | 4 ++++ kernel/cgroup.c | 3 +++ mm/shmem.c | 3 +++ 22 files changed, 127 insertions(+), 15 deletions(-)
drivers/isdn/capi/capifs.c +4 -0
@@ -16,6 +16,7 @@#include <linux/init.h> #include <linux/ctype.h> #include <linux/sched.h> /* current */ +#include <linux/smp_lock.h> #include "capifs.h"
@@ -75,6 +76,8 @@ static int capifs_remount(struct super_block *s, int *flags, char *data) } } +lock_kernel (); +mutex_lock (&s->s_root->d_inode->i_mutex);replace_mount_options (s, new_opt);
@@ -86,6 +89,7 @@ static int capifs_remount(struct super_block *s, int *flags, char *data)mutex_unlock (&s->s_root->d_inode->i_mutex); +unlock_kernel ();return 0 ; }
drivers/usb/core/inode.c +5 -0
@@ -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 ; }
fs/affs/super.c +6 -1
@@ -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;
@@ -510,6 +511,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;
@@ -517,8 +519,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)
@@ -527,6 +531,7 @@ affs_remount(struct super_block *sb, int *flags, char *data) }else res =affs_init_bitmap (sb, flags); +unlock_kernel ();return res; }
fs/btrfs/super.c +8 -2
@@ -566,17 +566,22 @@ static int btrfs_remount(struct super_block *sb, int *flags, char *data)if ((*flags &MS_RDONLY ) == (sb->s_flags &MS_RDONLY ))return 0 ; +lock_kernel ();if (*flags &MS_RDONLY ) { sb->s_flags |=MS_RDONLY ; ret =btrfs_commit_super (root);WARN_ON (ret); }else { -if (root->fs_info->fs_devices->rw_devices ==0 ) +if (root->fs_info->fs_devices->rw_devices ==0 ) { +unlock_kernel ();return -EACCES ; + } -if (btrfs_super_log_root (&root->fs_info->super_copy) !=0 ) +if (btrfs_super_log_root (&root->fs_info->super_copy) !=0 ) { +unlock_kernel ();return -EINVAL ; + } ret =btrfs_cleanup_reloc_trees (root);WARN_ON (ret);
@@ -587,6 +592,7 @@ static int btrfs_remount(struct super_block *sb, int *flags, char *data) sb->s_flags &= ~MS_RDONLY ; } +unlock_kernel ();return 0 ; }
fs/ext2/super.c +10 -2
@@ -1161,6 +1161,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;
@@ -1196,12 +1198,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.
@@ -1228,12 +1234,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; }
fs/ext3/super.c +4 -0
@@ -2489,6 +2489,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;
@@ -2599,6 +2601,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;
@@ -2616,6 +2619,7 @@ restore_opts: }#endif unlock_super (sb); +unlock_kernel ();return err; }
fs/ext4/super.c +4 -0
@@ -3373,6 +3373,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;
@@ -3518,6 +3520,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: sb->s_flags = old_sb_flags;
@@ -3537,6 +3540,7 @@ restore_opts: }#endif unlock_super (sb); +unlock_kernel ();return err; }
fs/hpfs/super.c +4 -0
@@ -13,6 +13,7 @@#include <linux/statfs.h> #include <linux/magic.h> #include <linux/sched.h> +#include <linux/smp_lock.h> /* Mark the filesystem dirty, so that chkdsk checks it when os/2 booted */
@@ -398,6 +399,7 @@ static int hpfs_remount_fs(struct super_block *s, int *flags, char *data) *flags |=MS_NOATIME ; +lock_kernel ();lock_super (s); uid = sbi->sb_uid; gid = sbi->sb_gid; umask =0777 & ~sbi->sb_mode;
@@ -432,10 +434,12 @@ static int hpfs_remount_fs(struct super_block *s, int *flags, char *data)replace_mount_options (s, new_opts);unlock_super (s); +unlock_kernel ();return 0 ; out_err:unlock_super (s); +unlock_kernel ();kfree (new_opts);return -EINVAL ; }
fs/jffs2/fs.c +3 -0
@@ -20,6 +20,7 @@#include <linux/vmalloc.h> #include <linux/vfs.h> #include <linux/crc32.h> +#include <linux/smp_lock.h> #include "nodelist.h" static int jffs2_flash_setup (struct jffs2_sb_info *c);
@@ -387,6 +388,7 @@ int jffs2_remount_fs (struct super_block *sb, int *flags, char *data)This also catches the case where it was stopped and this is just a remount to restart it. Flush the writebuffer, if neccecary, else we loose it */ +lock_kernel ();if (!(sb->s_flags &MS_RDONLY )) {jffs2_stop_garbage_collect_thread (c);mutex_lock (&c->alloc_sem);
@@ -399,6 +401,7 @@ int jffs2_remount_fs (struct super_block *sb, int *flags, char *data) *flags |=MS_NOATIME ; +unlock_kernel ();return 0 ; }
fs/jfs/super.c +18 -4
@@ -32,6 +32,7 @@#include <linux/crc32.h> #include <asm/uaccess.h> #include <linux/seq_file.h> +#include <linux/smp_lock.h> #include "jfs_incore.h" #include "jfs_filsys.h"
@@ -375,19 +376,24 @@ static int jfs_remount(struct super_block *sb, int *flags, char *data)s64 newLVSize =0 ;int rc =0 ;int flag =JFS_SBI (sb)->flag; +int ret;if (!parse_options (data, sb, &newLVSize, &flag)) {return -EINVAL ; } +lock_kernel ();if (newLVSize) {if (sb->s_flags &MS_RDONLY ) {printk (KERN_ERR "JFS: resize requires volume to be mounted read-write\n" ); +unlock_kernel ();return -EROFS ; } rc =jfs_extendfs (sb, newLVSize,0 ); -if (rc) +if (rc) { +unlock_kernel ();return rc; + } }if ((sb->s_flags &MS_RDONLY ) && !(*flags &MS_RDONLY )) {
@@ -398,23 +404,31 @@ static int jfs_remount(struct super_block *sb, int *flags, char *data)truncate_inode_pages (JFS_SBI (sb)->direct_inode->i_mapping,0 );JFS_SBI (sb)->flag = flag; -return jfs_mount_rw (sb,1 ); + ret =jfs_mount_rw (sb,1 ); +unlock_kernel (); +return ret; }if ((!(sb->s_flags &MS_RDONLY )) && (*flags &MS_RDONLY )) { rc =jfs_umount_rw (sb);JFS_SBI (sb)->flag = flag; +unlock_kernel ();return rc; }if ((JFS_SBI (sb)->flag &JFS_NOINTEGRITY ) != (flag &JFS_NOINTEGRITY ))if (!(sb->s_flags &MS_RDONLY )) { rc =jfs_umount_rw (sb); -if (rc) +if (rc) { +unlock_kernel ();return rc; + }JFS_SBI (sb)->flag = flag; -return jfs_mount_rw (sb,1 ); + ret =jfs_mount_rw (sb,1 ); +unlock_kernel (); +return ret; }JFS_SBI (sb)->flag = flag; +unlock_kernel ();return 0 ; }
fs/nfs/super.c +2 -0
@@ -1813,6 +1813,7 @@ nfs_remount(struct super_block *sb, int *flags, char *raw_data)if (data ==NULL )return -ENOMEM ; +lock_kernel ();/* fill out struct with values from existing mount */ data->flags = nfss->flags; data->rsize = nfss->rsize;
@@ -1837,6 +1838,7 @@ nfs_remount(struct super_block *sb, int *flags, char *raw_data) error =nfs_compare_remount_data (nfss, data); out:kfree (data); +unlock_kernel ();return error; }
fs/nilfs2/super.c +4 -0
@@ -906,6 +906,8 @@ static int nilfs_remount(struct super_block *sb, int *flags, char *data)struct nilfs_mount_options old_opts;int err; +lock_kernel (); + old_sb_flags = sb->s_flags; old_opts.mount_opt = sbi->s_mount_opt; old_opts.snapshot_cno = sbi->s_snapshot_cno;
@@ -985,6 +987,7 @@ static int nilfs_remount(struct super_block *sb, int *flags, char *data)up (&sb->s_bdev->bd_mount_sem); } out: +unlock_kernel ();return 0 ; rw_remount_failed:
@@ -993,6 +996,7 @@ static int nilfs_remount(struct super_block *sb, int *flags, char *data) sb->s_flags = old_sb_flags; sbi->s_mount_opt = old_opts.mount_opt; sbi->s_snapshot_cno = old_opts.snapshot_cno; +unlock_kernel ();return err; }
fs/ntfs/super.c +14 -1
@@ -443,6 +443,8 @@ static int ntfs_remount(struct super_block *sb, int *flags, char *opt)ntfs_volume *vol =NTFS_SB (sb);ntfs_debug ("Entering with remount options string: %s" , opt); + +lock_kernel ();#ifndef NTFS_RW /* For read-only compiled driver, enforce read-only flag. */ *flags |=MS_RDONLY ;
@@ -466,15 +468,18 @@ static int ntfs_remount(struct super_block *sb, int *flags, char *opt)if (NVolErrors (vol)) {ntfs_error (sb,"Volume has errors and is read-only%s" , es); +unlock_kernel ();return -EROFS ; }if (vol->vol_flags &VOLUME_IS_DIRTY ) {ntfs_error (sb,"Volume is dirty and read-only%s" , es); +unlock_kernel ();return -EROFS ; }if (vol->vol_flags &VOLUME_MODIFIED_BY_CHKDSK ) {ntfs_error (sb,"Volume has been modified by chkdsk " "and is read-only%s" , es); +unlock_kernel ();return -EROFS ; }if (vol->vol_flags &VOLUME_MUST_MOUNT_RO_MASK ) {
@@ -482,11 +487,13 @@ static int ntfs_remount(struct super_block *sb, int *flags, char *opt)"(0x%x) and is read-only%s" , (unsigned )le16_to_cpu (vol->vol_flags), es); +unlock_kernel ();return -EROFS ; }if (ntfs_set_volume_flags (vol,VOLUME_IS_DIRTY )) {ntfs_error (sb,"Failed to set dirty bit in volume " "information flags%s" , es); +unlock_kernel ();return -EROFS ; }#if 0
@@ -506,18 +513,21 @@ static int ntfs_remount(struct super_block *sb, int *flags, char *opt)ntfs_error (sb,"Failed to empty journal $LogFile%s" , es);NVolSetErrors (vol); +unlock_kernel ();return -EROFS ; }if (!ntfs_mark_quotas_out_of_date (vol)) {ntfs_error (sb,"Failed to mark quotas out of date%s" , es);NVolSetErrors (vol); +unlock_kernel ();return -EROFS ; }if (!ntfs_stamp_usnjrnl (vol)) {ntfs_error (sb,"Failed to stamp transation log " "($UsnJrnl)%s" , es);NVolSetErrors (vol); +unlock_kernel ();return -EROFS ; } }else if (!(sb->s_flags &MS_RDONLY ) && (*flags &MS_RDONLY )) {
@@ -533,8 +543,11 @@ static int ntfs_remount(struct super_block *sb, int *flags, char *opt)// TODO: Deal with *flags. -if (!parse_options (vol, opt)) +if (!parse_options (vol, opt)) { +unlock_kernel ();return -EINVAL ; + } +unlock_kernel ();ntfs_debug ("Done." );return 0 ; }
fs/ocfs2/super.c +4 -0
@@ -42,6 +42,7 @@#include <linux/mount.h> #include <linux/seq_file.h> #include <linux/quotaops.h> +#include <linux/smp_lock.h> #define MLOG_MASK_PREFIX ML_SUPER#include <cluster/masklog.h>
@@ -581,6 +582,8 @@ static int ocfs2_remount(struct super_block *sb, int *flags, char *data)struct mount_options parsed_options;struct ocfs2_super *osb =OCFS2_SB (sb); +lock_kernel (); +if (!ocfs2_parse_options (sb, data, &parsed_options,1 )) { ret = -EINVAL ; goto out;
@@ -684,6 +687,7 @@ unlock_osb:ocfs2_set_journal_params (osb); } out: +unlock_kernel ();return ret; }
fs/reiserfs/super.c +4 -0
@@ -28,6 +28,7 @@#include <linux/mount.h> #include <linux/namei.h> #include <linux/crc32.h> +#include <linux/smp_lock.h> struct file_system_type reiserfs_fs_type;
@@ -1197,6 +1198,7 @@ static int reiserfs_remount(struct super_block *s, int *mount_flags, char *arg)memcpy (qf_names,REISERFS_SB (s)->s_qf_names,sizeof (qf_names));#endif +lock_kernel (); rs =SB_DISK_SUPER_BLOCK (s); if (!reiserfs_parse_options
@@ -1319,10 +1321,12 @@ static int reiserfs_remount(struct super_block *s, int *mount_flags, char *arg) out_ok:replace_mount_options (s, new_opts); +unlock_kernel ();return 0 ; out_err:kfree (new_opts); +unlock_kernel ();return err; }
fs/super.c +0 -2
@@ -542,7 +542,6 @@ int do_remount_sb(struct super_block *sb, int flags, void *data, int force)shrink_dcache_sb (sb);sync_filesystem (sb); -lock_kernel ();/* If we are remounting RDONLY and current sb is read/write, make sure there are no rw files opened */ if ((flags &MS_RDONLY ) && !(sb->s_flags &MS_RDONLY )) {
@@ -562,7 +561,6 @@ int do_remount_sb(struct super_block *sb, int flags, void *data, int force)return retval; } sb->s_flags = (sb->s_flags & ~MS_RMT_MASK ) | (flags &MS_RMT_MASK ); -unlock_kernel ();if (remount_rw)vfs_dq_quota_on_remount (sb);return 0 ;
fs/ubifs/super.c +8 -1
@@ -36,6 +36,7 @@#include <linux/mount.h> #include <linux/math64.h> #include <linux/writeback.h> +#include <linux/smp_lock.h> #include "ubifs.h" /*
@@ -1770,17 +1771,22 @@ static int ubifs_remount_fs(struct super_block *sb, int *flags, char *data)return err; } +lock_kernel ();if ((sb->s_flags &MS_RDONLY ) && !(*flags &MS_RDONLY )) {if (c->ro_media) {ubifs_msg ("cannot re-mount due to prior errors" ); +unlock_kernel ();return -EROFS ; } err =ubifs_remount_rw (c); -if (err) +if (err) { +unlock_kernel ();return err; + } }else if (!(sb->s_flags &MS_RDONLY ) && (*flags &MS_RDONLY )) {if (c->ro_media) {ubifs_msg ("cannot re-mount due to prior errors" ); +unlock_kernel ();return -EROFS ; }ubifs_remount_ro (c);
@@ -1795,6 +1801,7 @@ static int ubifs_remount_fs(struct super_block *sb, int *flags, char *data) }ubifs_assert (c->lst.taken_empty_lebs >0 ); +unlock_kernel ();return 0 ; }
fs/udf/super.c +5 -1
@@ -568,6 +568,7 @@ static int udf_remount_fs(struct super_block *sb, int *flags, char *options)if (!udf_parse_options (options, &uopt, true))return -EINVAL ; +lock_kernel (); sbi->s_flags = uopt.flags; sbi->s_uid = uopt.uid; sbi->s_gid = uopt.gid;
@@ -581,13 +582,16 @@ static int udf_remount_fs(struct super_block *sb, int *flags, char *options) *flags |=MS_RDONLY ; } -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 )udf_close_lvid (sb);else udf_open_lvid (sb); +unlock_kernel ();return 0 ; }
fs/ufs/super.c +10 -1
@@ -263,6 +263,7 @@ void ufs_panic (struct super_block * sb, const char * function,struct ufs_super_block_first * usb1;va_list args; +lock_kernel (); uspi =UFS_SB (sb)->s_uspi; usb1 =ubh_get_usb_first (uspi);
@@ -1180,7 +1181,8 @@ static int ufs_remount (struct super_block *sb, int *mount_flags, char *data)struct ufs_super_block_third * usb3;unsigned new_mount_opt, ufstype;unsigned flags; - + +lock_kernel ();lock_super (sb); uspi =UFS_SB (sb)->s_uspi; flags =UFS_SB (sb)->s_flags;
@@ -1196,6 +1198,7 @@ static int ufs_remount (struct super_block *sb, int *mount_flags, char *data)ufs_set_opt (new_mount_opt,ONERROR_LOCK );if (!ufs_parse_options (data, &new_mount_opt)) {unlock_super (sb); +unlock_kernel ();return -EINVAL ; }if (!(new_mount_opt &UFS_MOUNT_UFSTYPE )) {
@@ -1203,12 +1206,14 @@ static int ufs_remount (struct super_block *sb, int *mount_flags, char *data) }else if ((new_mount_opt &UFS_MOUNT_UFSTYPE ) != ufstype) {printk ("ufstype can't be changed during remount\n" );unlock_super (sb); +unlock_kernel ();return -EINVAL ; }if ((*mount_flags &MS_RDONLY ) == (sb->s_flags &MS_RDONLY )) {UFS_SB (sb)->s_mount_opt = new_mount_opt;unlock_super (sb); +unlock_kernel ();return 0 ; }
@@ -1234,6 +1239,7 @@ static int ufs_remount (struct super_block *sb, int *mount_flags, char *data)printk ("ufs was compiled with read-only support, " "can't be mounted as read-write\n" );unlock_super (sb); +unlock_kernel ();return -EINVAL ;#else if (ufstype != UFS_MOUNT_UFSTYPE_SUN &&
@@ -1243,11 +1249,13 @@ static int ufs_remount (struct super_block *sb, int *mount_flags, char *data) ufstype != UFS_MOUNT_UFSTYPE_UFS2) {printk ("this ufstype is read-only supported\n" );unlock_super (sb); +unlock_kernel ();return -EINVAL ; }if (!ufs_read_cylinder_structures (sb)) {printk ("failed during remounting\n" );unlock_super (sb); +unlock_kernel ();return -EPERM ; } sb->s_flags &= ~MS_RDONLY ;
@@ -1255,6 +1263,7 @@ static int ufs_remount (struct super_block *sb, int *mount_flags, char *data) }UFS_SB (sb)->s_mount_opt = new_mount_opt;unlock_super (sb); +unlock_kernel ();return 0 ; }
fs/xfs/linux-2.6/xfs_super.c +4 -0
@@ -67,6 +67,7 @@#include <linux/kthread.h> #include <linux/freezer.h> #include <linux/parser.h> +#include <linux/smp_lock.h> static struct super_operations xfs_super_operations;static kmem_zone_t *xfs_ioend_zone;
@@ -1215,6 +1216,7 @@ xfs_fs_remount(char *p;int error; +lock_kernel ();while ((p =strsep (&options,"," )) !=NULL ) {int token;
@@ -1279,6 +1281,7 @@ xfs_fs_remount(if (error) {cmn_err (CE_WARN ,"XFS: failed to write sb changes" ); +unlock_kernel ();return error; } mp->m_update_flags =0 ;
@@ -1292,6 +1295,7 @@ xfs_fs_remount( mp->m_flags |=XFS_MOUNT_RDONLY ; } +unlock_kernel ();return 0 ; }
kernel/cgroup.c +3 -0
@@ -46,6 +46,7 @@#include <linux/cgroupstats.h> #include <linux/hash.h> #include <linux/namei.h> +#include <linux/smp_lock.h> #include <asm/atomic.h>
@@ -900,6 +901,7 @@ static int cgroup_remount(struct super_block *sb, int *flags, char *data)struct cgroup *cgrp = &root->top_cgroup;struct cgroup_sb_opts opts; +lock_kernel ();mutex_lock (&cgrp->dentry->d_inode->i_mutex);mutex_lock (&cgroup_mutex);
@@ -927,6 +929,7 @@ static int cgroup_remount(struct super_block *sb, int *flags, char *data)kfree (opts.release_agent);mutex_unlock (&cgroup_mutex);mutex_unlock (&cgrp->dentry->d_inode->i_mutex); +unlock_kernel ();return ret; }
mm/shmem.c +3 -0
@@ -30,6 +30,7 @@#include <linux/module.h> #include <linux/swap.h> #include <linux/ima.h> +#include <linux/smp_lock.h> static struct vfsmount *shm_mnt;
@@ -2240,6 +2241,7 @@ static int shmem_remount_fs(struct super_block *sb, int *flags, char *data)if (shmem_parse_options (data, &config, true))return error; +lock_kernel ();spin_lock (&sbinfo->stat_lock); blocks = sbinfo->max_blocks - sbinfo->free_blocks; inodes = sbinfo->max_inodes - sbinfo->free_inodes;
@@ -2268,6 +2270,7 @@ static int shmem_remount_fs(struct super_block *sb, int *flags, char *data) sbinfo->mpol = config.mpol;/* transfers initial ref */ out:spin_unlock (&sbinfo->stat_lock); +unlock_kernel ();return error; }
Signature · 1 line
1.6.0.4