reiserfs: Fix resuming of quotas on remount read-write
Jan Kara
reviewerPATCH 1/2 reiserfs: Fix resuming of quotas on remount read-write
When quota was suspended on remount-ro, finish_unfinished() will try to turn it on again (which fails) and also turns the quotas off on exit. Fix the function to check whether quotas are already on at function entry and do not turn them off in that case.
Signed-off-by Jan Kara <[email protected]>
--- fs/reiserfs/super.c | 12 ++++++++++-- 1 files changed, 10 insertions(+), 2 deletions(-)
I plan to send this fix to Linus soon. Review is welcome.
fs/reiserfs/super.c +10 -2
@@ -158,6 +158,7 @@ static int finish_unfinished(struct super_block *s)#ifdef CONFIG_QUOTA int i;int ms_active_set; +int quota_enabled[MAXQUOTAS ];#endif /* compose key to look for "save" links */
@@ -179,8 +180,15 @@ static int finish_unfinished(struct super_block *s) }/* Turn on quotas so that they are updated correctly */ for (i =0 ; i <MAXQUOTAS ; i++) { + quota_enabled[i] =1 ;if (REISERFS_SB (s)->s_qf_names[i]) { -int ret =reiserfs_quota_on_mount (s, i); +int ret; + +if (sb_has_quota_active (s, i)) { + quota_enabled[i] =0 ; +continue ; + } + ret =reiserfs_quota_on_mount (s, i);if (ret <0 )reiserfs_warning (s,"reiserfs-2500" , "cannot turn on journaled "
@@ -304,7 +312,7 @@ static int finish_unfinished(struct super_block *s)#ifdef CONFIG_QUOTA /* Turn quotas off */ for (i =0 ; i <MAXQUOTAS ; i++) { -if (sb_dqopt (s)->files[i]) +if (sb_dqopt (s)->files[i] && quota_enabled[i])dquot_quota_off (s, i); }if (ms_active_set)
Signature · 1 line
1.6.4.2
Jan Kara
reviewerPATCH 2/2 quota: Fixup dquot_transfer
Commit bc8e5f07392f05c47c8bdeff4f7098db440d065c had a typo which caused quota miscomputation when changing owner group of a file. Linus will hate me.
Signed-off-by Jan Kara <[email protected]>
--- fs/quota/dquot.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)
I plan to send this fix to Linus soon. Comments welcome.
fs/quota/dquot.c +1 -1
@@ -1812,7 +1812,7 @@ int dquot_transfer(struct inode *inode, struct iattr *iattr)if (iattr->ia_valid &ATTR_UID && iattr->ia_uid != inode->i_uid) transfer_to[USRQUOTA ] =dqget (sb, iattr->ia_uid,USRQUOTA );if (iattr->ia_valid &ATTR_GID && iattr->ia_gid != inode->i_gid) - transfer_to[GRPQUOTA ] =dqget (sb, iattr->ia_uid,GRPQUOTA ); + transfer_to[GRPQUOTA ] =dqget (sb, iattr->ia_gid,GRPQUOTA ); ret =__dquot_transfer (inode, transfer_to);dqput_all (transfer_to);
Signature · 1 line
1.6.4.2