aboutsummaryrefslogtreecommitdiffstats
path: root/fs/jfs/super.c
diff options
context:
space:
mode:
Diffstat (limited to 'fs/jfs/super.c')
-rw-r--r--fs/jfs/super.c27
1 files changed, 23 insertions, 4 deletions
diff --git a/fs/jfs/super.c b/fs/jfs/super.c
index d9b0e92b3602..09b1b6ee2186 100644
--- a/fs/jfs/super.c
+++ b/fs/jfs/super.c
@@ -32,6 +32,7 @@
32#include <linux/crc32.h> 32#include <linux/crc32.h>
33#include <asm/uaccess.h> 33#include <asm/uaccess.h>
34#include <linux/seq_file.h> 34#include <linux/seq_file.h>
35#include <linux/smp_lock.h>
35 36
36#include "jfs_incore.h" 37#include "jfs_incore.h"
37#include "jfs_filsys.h" 38#include "jfs_filsys.h"
@@ -183,6 +184,9 @@ static void jfs_put_super(struct super_block *sb)
183 int rc; 184 int rc;
184 185
185 jfs_info("In jfs_put_super"); 186 jfs_info("In jfs_put_super");
187
188 lock_kernel();
189
186 rc = jfs_umount(sb); 190 rc = jfs_umount(sb);
187 if (rc) 191 if (rc)
188 jfs_err("jfs_umount failed with return code %d", rc); 192 jfs_err("jfs_umount failed with return code %d", rc);
@@ -195,6 +199,8 @@ static void jfs_put_super(struct super_block *sb)
195 sbi->direct_inode = NULL; 199 sbi->direct_inode = NULL;
196 200
197 kfree(sbi); 201 kfree(sbi);
202
203 unlock_kernel();
198} 204}
199 205
200enum { 206enum {
@@ -370,19 +376,24 @@ static int jfs_remount(struct super_block *sb, int *flags, char *data)
370 s64 newLVSize = 0; 376 s64 newLVSize = 0;
371 int rc = 0; 377 int rc = 0;
372 int flag = JFS_SBI(sb)->flag; 378 int flag = JFS_SBI(sb)->flag;
379 int ret;
373 380
374 if (!parse_options(data, sb, &newLVSize, &flag)) { 381 if (!parse_options(data, sb, &newLVSize, &flag)) {
375 return -EINVAL; 382 return -EINVAL;
376 } 383 }
384 lock_kernel();
377 if (newLVSize) { 385 if (newLVSize) {
378 if (sb->s_flags & MS_RDONLY) { 386 if (sb->s_flags & MS_RDONLY) {
379 printk(KERN_ERR 387 printk(KERN_ERR
380 "JFS: resize requires volume to be mounted read-write\n"); 388 "JFS: resize requires volume to be mounted read-write\n");
389 unlock_kernel();
381 return -EROFS; 390 return -EROFS;
382 } 391 }
383 rc = jfs_extendfs(sb, newLVSize, 0); 392 rc = jfs_extendfs(sb, newLVSize, 0);
384 if (rc) 393 if (rc) {
394 unlock_kernel();
385 return rc; 395 return rc;
396 }
386 } 397 }
387 398
388 if ((sb->s_flags & MS_RDONLY) && !(*flags & MS_RDONLY)) { 399 if ((sb->s_flags & MS_RDONLY) && !(*flags & MS_RDONLY)) {
@@ -393,23 +404,31 @@ static int jfs_remount(struct super_block *sb, int *flags, char *data)
393 truncate_inode_pages(JFS_SBI(sb)->direct_inode->i_mapping, 0); 404 truncate_inode_pages(JFS_SBI(sb)->direct_inode->i_mapping, 0);
394 405
395 JFS_SBI(sb)->flag = flag; 406 JFS_SBI(sb)->flag = flag;
396 return jfs_mount_rw(sb, 1); 407 ret = jfs_mount_rw(sb, 1);
408 unlock_kernel();
409 return ret;
397 } 410 }
398 if ((!(sb->s_flags & MS_RDONLY)) && (*flags & MS_RDONLY)) { 411 if ((!(sb->s_flags & MS_RDONLY)) && (*flags & MS_RDONLY)) {
399 rc = jfs_umount_rw(sb); 412 rc = jfs_umount_rw(sb);
400 JFS_SBI(sb)->flag = flag; 413 JFS_SBI(sb)->flag = flag;
414 unlock_kernel();
401 return rc; 415 return rc;
402 } 416 }
403 if ((JFS_SBI(sb)->flag & JFS_NOINTEGRITY) != (flag & JFS_NOINTEGRITY)) 417 if ((JFS_SBI(sb)->flag & JFS_NOINTEGRITY) != (flag & JFS_NOINTEGRITY))
404 if (!(sb->s_flags & MS_RDONLY)) { 418 if (!(sb->s_flags & MS_RDONLY)) {
405 rc = jfs_umount_rw(sb); 419 rc = jfs_umount_rw(sb);
406 if (rc) 420 if (rc) {
421 unlock_kernel();
407 return rc; 422 return rc;
423 }
408 JFS_SBI(sb)->flag = flag; 424 JFS_SBI(sb)->flag = flag;
409 return jfs_mount_rw(sb, 1); 425 ret = jfs_mount_rw(sb, 1);
426 unlock_kernel();
427 return ret;
410 } 428 }
411 JFS_SBI(sb)->flag = flag; 429 JFS_SBI(sb)->flag = flag;
412 430
431 unlock_kernel();
413 return 0; 432 return 0;
414} 433}
415 434