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.c22
1 files changed, 18 insertions, 4 deletions
diff --git a/fs/jfs/super.c b/fs/jfs/super.c
index 3eb13adf3862..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"
@@ -375,19 +376,24 @@ static int jfs_remount(struct super_block *sb, int *flags, char *data)
375 s64 newLVSize = 0; 376 s64 newLVSize = 0;
376 int rc = 0; 377 int rc = 0;
377 int flag = JFS_SBI(sb)->flag; 378 int flag = JFS_SBI(sb)->flag;
379 int ret;
378 380
379 if (!parse_options(data, sb, &newLVSize, &flag)) { 381 if (!parse_options(data, sb, &newLVSize, &flag)) {
380 return -EINVAL; 382 return -EINVAL;
381 } 383 }
384 lock_kernel();
382 if (newLVSize) { 385 if (newLVSize) {
383 if (sb->s_flags & MS_RDONLY) { 386 if (sb->s_flags & MS_RDONLY) {
384 printk(KERN_ERR 387 printk(KERN_ERR
385 "JFS: resize requires volume to be mounted read-write\n"); 388 "JFS: resize requires volume to be mounted read-write\n");
389 unlock_kernel();
386 return -EROFS; 390 return -EROFS;
387 } 391 }
388 rc = jfs_extendfs(sb, newLVSize, 0); 392 rc = jfs_extendfs(sb, newLVSize, 0);
389 if (rc) 393 if (rc) {
394 unlock_kernel();
390 return rc; 395 return rc;
396 }
391 } 397 }
392 398
393 if ((sb->s_flags & MS_RDONLY) && !(*flags & MS_RDONLY)) { 399 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)
398 truncate_inode_pages(JFS_SBI(sb)->direct_inode->i_mapping, 0); 404 truncate_inode_pages(JFS_SBI(sb)->direct_inode->i_mapping, 0);
399 405
400 JFS_SBI(sb)->flag = flag; 406 JFS_SBI(sb)->flag = flag;
401 return jfs_mount_rw(sb, 1); 407 ret = jfs_mount_rw(sb, 1);
408 unlock_kernel();
409 return ret;
402 } 410 }
403 if ((!(sb->s_flags & MS_RDONLY)) && (*flags & MS_RDONLY)) { 411 if ((!(sb->s_flags & MS_RDONLY)) && (*flags & MS_RDONLY)) {
404 rc = jfs_umount_rw(sb); 412 rc = jfs_umount_rw(sb);
405 JFS_SBI(sb)->flag = flag; 413 JFS_SBI(sb)->flag = flag;
414 unlock_kernel();
406 return rc; 415 return rc;
407 } 416 }
408 if ((JFS_SBI(sb)->flag & JFS_NOINTEGRITY) != (flag & JFS_NOINTEGRITY)) 417 if ((JFS_SBI(sb)->flag & JFS_NOINTEGRITY) != (flag & JFS_NOINTEGRITY))
409 if (!(sb->s_flags & MS_RDONLY)) { 418 if (!(sb->s_flags & MS_RDONLY)) {
410 rc = jfs_umount_rw(sb); 419 rc = jfs_umount_rw(sb);
411 if (rc) 420 if (rc) {
421 unlock_kernel();
412 return rc; 422 return rc;
423 }
413 JFS_SBI(sb)->flag = flag; 424 JFS_SBI(sb)->flag = flag;
414 return jfs_mount_rw(sb, 1); 425 ret = jfs_mount_rw(sb, 1);
426 unlock_kernel();
427 return ret;
415 } 428 }
416 JFS_SBI(sb)->flag = flag; 429 JFS_SBI(sb)->flag = flag;
417 430
431 unlock_kernel();
418 return 0; 432 return 0;
419} 433}
420 434