diff options
Diffstat (limited to 'fs/ext3/super.c')
-rw-r--r-- | fs/ext3/super.c | 26 |
1 files changed, 16 insertions, 10 deletions
diff --git a/fs/ext3/super.c b/fs/ext3/super.c index 6900ff05e3ab..5d047a030a73 100644 --- a/fs/ext3/super.c +++ b/fs/ext3/super.c | |||
@@ -439,6 +439,7 @@ static void ext3_put_super (struct super_block * sb) | |||
439 | ext3_blkdev_remove(sbi); | 439 | ext3_blkdev_remove(sbi); |
440 | } | 440 | } |
441 | sb->s_fs_info = NULL; | 441 | sb->s_fs_info = NULL; |
442 | kfree(sbi->s_blockgroup_lock); | ||
442 | kfree(sbi); | 443 | kfree(sbi); |
443 | return; | 444 | return; |
444 | } | 445 | } |
@@ -733,7 +734,9 @@ static struct dquot_operations ext3_quota_operations = { | |||
733 | .acquire_dquot = ext3_acquire_dquot, | 734 | .acquire_dquot = ext3_acquire_dquot, |
734 | .release_dquot = ext3_release_dquot, | 735 | .release_dquot = ext3_release_dquot, |
735 | .mark_dirty = ext3_mark_dquot_dirty, | 736 | .mark_dirty = ext3_mark_dquot_dirty, |
736 | .write_info = ext3_write_info | 737 | .write_info = ext3_write_info, |
738 | .alloc_dquot = dquot_alloc, | ||
739 | .destroy_dquot = dquot_destroy, | ||
737 | }; | 740 | }; |
738 | 741 | ||
739 | static struct quotactl_ops ext3_qctl_operations = { | 742 | static struct quotactl_ops ext3_qctl_operations = { |
@@ -1056,8 +1059,7 @@ static int parse_options (char *options, struct super_block *sb, | |||
1056 | case Opt_grpjquota: | 1059 | case Opt_grpjquota: |
1057 | qtype = GRPQUOTA; | 1060 | qtype = GRPQUOTA; |
1058 | set_qf_name: | 1061 | set_qf_name: |
1059 | if ((sb_any_quota_enabled(sb) || | 1062 | if (sb_any_quota_loaded(sb) && |
1060 | sb_any_quota_suspended(sb)) && | ||
1061 | !sbi->s_qf_names[qtype]) { | 1063 | !sbi->s_qf_names[qtype]) { |
1062 | printk(KERN_ERR | 1064 | printk(KERN_ERR |
1063 | "EXT3-fs: Cannot change journaled " | 1065 | "EXT3-fs: Cannot change journaled " |
@@ -1096,8 +1098,7 @@ set_qf_name: | |||
1096 | case Opt_offgrpjquota: | 1098 | case Opt_offgrpjquota: |
1097 | qtype = GRPQUOTA; | 1099 | qtype = GRPQUOTA; |
1098 | clear_qf_name: | 1100 | clear_qf_name: |
1099 | if ((sb_any_quota_enabled(sb) || | 1101 | if (sb_any_quota_loaded(sb) && |
1100 | sb_any_quota_suspended(sb)) && | ||
1101 | sbi->s_qf_names[qtype]) { | 1102 | sbi->s_qf_names[qtype]) { |
1102 | printk(KERN_ERR "EXT3-fs: Cannot change " | 1103 | printk(KERN_ERR "EXT3-fs: Cannot change " |
1103 | "journaled quota options when " | 1104 | "journaled quota options when " |
@@ -1116,8 +1117,7 @@ clear_qf_name: | |||
1116 | case Opt_jqfmt_vfsv0: | 1117 | case Opt_jqfmt_vfsv0: |
1117 | qfmt = QFMT_VFS_V0; | 1118 | qfmt = QFMT_VFS_V0; |
1118 | set_qf_format: | 1119 | set_qf_format: |
1119 | if ((sb_any_quota_enabled(sb) || | 1120 | if (sb_any_quota_loaded(sb) && |
1120 | sb_any_quota_suspended(sb)) && | ||
1121 | sbi->s_jquota_fmt != qfmt) { | 1121 | sbi->s_jquota_fmt != qfmt) { |
1122 | printk(KERN_ERR "EXT3-fs: Cannot change " | 1122 | printk(KERN_ERR "EXT3-fs: Cannot change " |
1123 | "journaled quota options when " | 1123 | "journaled quota options when " |
@@ -1136,8 +1136,7 @@ set_qf_format: | |||
1136 | set_opt(sbi->s_mount_opt, GRPQUOTA); | 1136 | set_opt(sbi->s_mount_opt, GRPQUOTA); |
1137 | break; | 1137 | break; |
1138 | case Opt_noquota: | 1138 | case Opt_noquota: |
1139 | if (sb_any_quota_enabled(sb) || | 1139 | if (sb_any_quota_loaded(sb)) { |
1140 | sb_any_quota_suspended(sb)) { | ||
1141 | printk(KERN_ERR "EXT3-fs: Cannot change quota " | 1140 | printk(KERN_ERR "EXT3-fs: Cannot change quota " |
1142 | "options when quota turned on.\n"); | 1141 | "options when quota turned on.\n"); |
1143 | return 0; | 1142 | return 0; |
@@ -1569,6 +1568,13 @@ static int ext3_fill_super (struct super_block *sb, void *data, int silent) | |||
1569 | sbi = kzalloc(sizeof(*sbi), GFP_KERNEL); | 1568 | sbi = kzalloc(sizeof(*sbi), GFP_KERNEL); |
1570 | if (!sbi) | 1569 | if (!sbi) |
1571 | return -ENOMEM; | 1570 | return -ENOMEM; |
1571 | |||
1572 | sbi->s_blockgroup_lock = | ||
1573 | kzalloc(sizeof(struct blockgroup_lock), GFP_KERNEL); | ||
1574 | if (!sbi->s_blockgroup_lock) { | ||
1575 | kfree(sbi); | ||
1576 | return -ENOMEM; | ||
1577 | } | ||
1572 | sb->s_fs_info = sbi; | 1578 | sb->s_fs_info = sbi; |
1573 | sbi->s_mount_opt = 0; | 1579 | sbi->s_mount_opt = 0; |
1574 | sbi->s_resuid = EXT3_DEF_RESUID; | 1580 | sbi->s_resuid = EXT3_DEF_RESUID; |
@@ -1821,7 +1827,7 @@ static int ext3_fill_super (struct super_block *sb, void *data, int silent) | |||
1821 | goto failed_mount; | 1827 | goto failed_mount; |
1822 | } | 1828 | } |
1823 | 1829 | ||
1824 | bgl_lock_init(&sbi->s_blockgroup_lock); | 1830 | bgl_lock_init(sbi->s_blockgroup_lock); |
1825 | 1831 | ||
1826 | for (i = 0; i < db_count; i++) { | 1832 | for (i = 0; i < db_count; i++) { |
1827 | block = descriptor_loc(sb, logic_sb_block, i); | 1833 | block = descriptor_loc(sb, logic_sb_block, i); |