diff options
Diffstat (limited to 'fs/super.c')
-rw-r--r-- | fs/super.c | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/fs/super.c b/fs/super.c index 4798350b2bc9..453877c5697b 100644 --- a/fs/super.c +++ b/fs/super.c | |||
@@ -117,7 +117,7 @@ static inline void destroy_super(struct super_block *s) | |||
117 | * Drop a superblock's refcount. Returns non-zero if the superblock was | 117 | * Drop a superblock's refcount. Returns non-zero if the superblock was |
118 | * destroyed. The caller must hold sb_lock. | 118 | * destroyed. The caller must hold sb_lock. |
119 | */ | 119 | */ |
120 | int __put_super(struct super_block *sb) | 120 | static int __put_super(struct super_block *sb) |
121 | { | 121 | { |
122 | int ret = 0; | 122 | int ret = 0; |
123 | 123 | ||
@@ -179,7 +179,7 @@ void deactivate_super(struct super_block *s) | |||
179 | if (atomic_dec_and_lock(&s->s_active, &sb_lock)) { | 179 | if (atomic_dec_and_lock(&s->s_active, &sb_lock)) { |
180 | s->s_count -= S_BIAS-1; | 180 | s->s_count -= S_BIAS-1; |
181 | spin_unlock(&sb_lock); | 181 | spin_unlock(&sb_lock); |
182 | DQUOT_OFF(s); | 182 | DQUOT_OFF(s, 0); |
183 | down_write(&s->s_umount); | 183 | down_write(&s->s_umount); |
184 | fs->kill_sb(s); | 184 | fs->kill_sb(s); |
185 | put_filesystem(fs); | 185 | put_filesystem(fs); |
@@ -608,6 +608,7 @@ retry: | |||
608 | int do_remount_sb(struct super_block *sb, int flags, void *data, int force) | 608 | int do_remount_sb(struct super_block *sb, int flags, void *data, int force) |
609 | { | 609 | { |
610 | int retval; | 610 | int retval; |
611 | int remount_rw; | ||
611 | 612 | ||
612 | #ifdef CONFIG_BLOCK | 613 | #ifdef CONFIG_BLOCK |
613 | if (!(flags & MS_RDONLY) && bdev_read_only(sb->s_bdev)) | 614 | if (!(flags & MS_RDONLY) && bdev_read_only(sb->s_bdev)) |
@@ -625,8 +626,11 @@ int do_remount_sb(struct super_block *sb, int flags, void *data, int force) | |||
625 | mark_files_ro(sb); | 626 | mark_files_ro(sb); |
626 | else if (!fs_may_remount_ro(sb)) | 627 | else if (!fs_may_remount_ro(sb)) |
627 | return -EBUSY; | 628 | return -EBUSY; |
628 | DQUOT_OFF(sb); | 629 | retval = DQUOT_OFF(sb, 1); |
630 | if (retval < 0 && retval != -ENOSYS) | ||
631 | return -EBUSY; | ||
629 | } | 632 | } |
633 | remount_rw = !(flags & MS_RDONLY) && (sb->s_flags & MS_RDONLY); | ||
630 | 634 | ||
631 | if (sb->s_op->remount_fs) { | 635 | if (sb->s_op->remount_fs) { |
632 | lock_super(sb); | 636 | lock_super(sb); |
@@ -636,6 +640,8 @@ int do_remount_sb(struct super_block *sb, int flags, void *data, int force) | |||
636 | return retval; | 640 | return retval; |
637 | } | 641 | } |
638 | sb->s_flags = (sb->s_flags & ~MS_RMT_MASK) | (flags & MS_RMT_MASK); | 642 | sb->s_flags = (sb->s_flags & ~MS_RMT_MASK) | (flags & MS_RMT_MASK); |
643 | if (remount_rw) | ||
644 | DQUOT_ON_REMOUNT(sb); | ||
639 | return 0; | 645 | return 0; |
640 | } | 646 | } |
641 | 647 | ||