diff options
Diffstat (limited to 'fs/reiserfs/super.c')
-rw-r--r-- | fs/reiserfs/super.c | 35 |
1 files changed, 20 insertions, 15 deletions
diff --git a/fs/reiserfs/super.c b/fs/reiserfs/super.c index 1215a4f50cd2..2969773cfc22 100644 --- a/fs/reiserfs/super.c +++ b/fs/reiserfs/super.c | |||
@@ -28,6 +28,7 @@ | |||
28 | #include <linux/mount.h> | 28 | #include <linux/mount.h> |
29 | #include <linux/namei.h> | 29 | #include <linux/namei.h> |
30 | #include <linux/crc32.h> | 30 | #include <linux/crc32.h> |
31 | #include <linux/smp_lock.h> | ||
31 | 32 | ||
32 | struct file_system_type reiserfs_fs_type; | 33 | struct file_system_type reiserfs_fs_type; |
33 | 34 | ||
@@ -64,18 +65,15 @@ static int reiserfs_statfs(struct dentry *dentry, struct kstatfs *buf); | |||
64 | 65 | ||
65 | static int reiserfs_sync_fs(struct super_block *s, int wait) | 66 | static int reiserfs_sync_fs(struct super_block *s, int wait) |
66 | { | 67 | { |
67 | if (!(s->s_flags & MS_RDONLY)) { | 68 | struct reiserfs_transaction_handle th; |
68 | struct reiserfs_transaction_handle th; | 69 | |
69 | reiserfs_write_lock(s); | 70 | reiserfs_write_lock(s); |
70 | if (!journal_begin(&th, s, 1)) | 71 | if (!journal_begin(&th, s, 1)) |
71 | if (!journal_end_sync(&th, s, 1)) | 72 | if (!journal_end_sync(&th, s, 1)) |
72 | reiserfs_flush_old_commits(s); | 73 | reiserfs_flush_old_commits(s); |
73 | s->s_dirt = 0; /* Even if it's not true. | 74 | s->s_dirt = 0; /* Even if it's not true. |
74 | * We'll loop forever in sync_supers otherwise */ | 75 | * We'll loop forever in sync_supers otherwise */ |
75 | reiserfs_write_unlock(s); | 76 | reiserfs_write_unlock(s); |
76 | } else { | ||
77 | s->s_dirt = 0; | ||
78 | } | ||
79 | return 0; | 77 | return 0; |
80 | } | 78 | } |
81 | 79 | ||
@@ -448,13 +446,11 @@ int remove_save_link(struct inode *inode, int truncate) | |||
448 | static void reiserfs_kill_sb(struct super_block *s) | 446 | static void reiserfs_kill_sb(struct super_block *s) |
449 | { | 447 | { |
450 | if (REISERFS_SB(s)) { | 448 | if (REISERFS_SB(s)) { |
451 | #ifdef CONFIG_REISERFS_FS_XATTR | ||
452 | if (REISERFS_SB(s)->xattr_root) { | 449 | if (REISERFS_SB(s)->xattr_root) { |
453 | d_invalidate(REISERFS_SB(s)->xattr_root); | 450 | d_invalidate(REISERFS_SB(s)->xattr_root); |
454 | dput(REISERFS_SB(s)->xattr_root); | 451 | dput(REISERFS_SB(s)->xattr_root); |
455 | REISERFS_SB(s)->xattr_root = NULL; | 452 | REISERFS_SB(s)->xattr_root = NULL; |
456 | } | 453 | } |
457 | #endif | ||
458 | if (REISERFS_SB(s)->priv_root) { | 454 | if (REISERFS_SB(s)->priv_root) { |
459 | d_invalidate(REISERFS_SB(s)->priv_root); | 455 | d_invalidate(REISERFS_SB(s)->priv_root); |
460 | dput(REISERFS_SB(s)->priv_root); | 456 | dput(REISERFS_SB(s)->priv_root); |
@@ -470,6 +466,11 @@ static void reiserfs_put_super(struct super_block *s) | |||
470 | struct reiserfs_transaction_handle th; | 466 | struct reiserfs_transaction_handle th; |
471 | th.t_trans_id = 0; | 467 | th.t_trans_id = 0; |
472 | 468 | ||
469 | lock_kernel(); | ||
470 | |||
471 | if (s->s_dirt) | ||
472 | reiserfs_write_super(s); | ||
473 | |||
473 | /* change file system state to current state if it was mounted with read-write permissions */ | 474 | /* change file system state to current state if it was mounted with read-write permissions */ |
474 | if (!(s->s_flags & MS_RDONLY)) { | 475 | if (!(s->s_flags & MS_RDONLY)) { |
475 | if (!journal_begin(&th, s, 10)) { | 476 | if (!journal_begin(&th, s, 10)) { |
@@ -502,7 +503,7 @@ static void reiserfs_put_super(struct super_block *s) | |||
502 | kfree(s->s_fs_info); | 503 | kfree(s->s_fs_info); |
503 | s->s_fs_info = NULL; | 504 | s->s_fs_info = NULL; |
504 | 505 | ||
505 | return; | 506 | unlock_kernel(); |
506 | } | 507 | } |
507 | 508 | ||
508 | static struct kmem_cache *reiserfs_inode_cachep; | 509 | static struct kmem_cache *reiserfs_inode_cachep; |
@@ -900,6 +901,7 @@ static int reiserfs_parse_options(struct super_block *s, char *options, /* strin | |||
900 | {"conv",.setmask = 1 << REISERFS_CONVERT}, | 901 | {"conv",.setmask = 1 << REISERFS_CONVERT}, |
901 | {"attrs",.setmask = 1 << REISERFS_ATTRS}, | 902 | {"attrs",.setmask = 1 << REISERFS_ATTRS}, |
902 | {"noattrs",.clrmask = 1 << REISERFS_ATTRS}, | 903 | {"noattrs",.clrmask = 1 << REISERFS_ATTRS}, |
904 | {"expose_privroot", .setmask = 1 << REISERFS_EXPOSE_PRIVROOT}, | ||
903 | #ifdef CONFIG_REISERFS_FS_XATTR | 905 | #ifdef CONFIG_REISERFS_FS_XATTR |
904 | {"user_xattr",.setmask = 1 << REISERFS_XATTRS_USER}, | 906 | {"user_xattr",.setmask = 1 << REISERFS_XATTRS_USER}, |
905 | {"nouser_xattr",.clrmask = 1 << REISERFS_XATTRS_USER}, | 907 | {"nouser_xattr",.clrmask = 1 << REISERFS_XATTRS_USER}, |
@@ -1195,6 +1197,7 @@ static int reiserfs_remount(struct super_block *s, int *mount_flags, char *arg) | |||
1195 | memcpy(qf_names, REISERFS_SB(s)->s_qf_names, sizeof(qf_names)); | 1197 | memcpy(qf_names, REISERFS_SB(s)->s_qf_names, sizeof(qf_names)); |
1196 | #endif | 1198 | #endif |
1197 | 1199 | ||
1200 | lock_kernel(); | ||
1198 | rs = SB_DISK_SUPER_BLOCK(s); | 1201 | rs = SB_DISK_SUPER_BLOCK(s); |
1199 | 1202 | ||
1200 | if (!reiserfs_parse_options | 1203 | if (!reiserfs_parse_options |
@@ -1317,10 +1320,12 @@ static int reiserfs_remount(struct super_block *s, int *mount_flags, char *arg) | |||
1317 | 1320 | ||
1318 | out_ok: | 1321 | out_ok: |
1319 | replace_mount_options(s, new_opts); | 1322 | replace_mount_options(s, new_opts); |
1323 | unlock_kernel(); | ||
1320 | return 0; | 1324 | return 0; |
1321 | 1325 | ||
1322 | out_err: | 1326 | out_err: |
1323 | kfree(new_opts); | 1327 | kfree(new_opts); |
1328 | unlock_kernel(); | ||
1324 | return err; | 1329 | return err; |
1325 | } | 1330 | } |
1326 | 1331 | ||