Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit f4b113ae authored by Jan Kara's avatar Jan Kara
Browse files

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.

CC: reiserfs-devel@vger.kernel.org
Signed-off-by: default avatarJan Kara <jack@suse.cz>
parent 36a32ae0
Loading
Loading
Loading
Loading
+10 −2
Original line number Original line Diff line number Diff line
@@ -158,6 +158,7 @@ static int finish_unfinished(struct super_block *s)
#ifdef CONFIG_QUOTA
#ifdef CONFIG_QUOTA
	int i;
	int i;
	int ms_active_set;
	int ms_active_set;
	int quota_enabled[MAXQUOTAS];
#endif
#endif


	/* compose key to look for "save" links */
	/* 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 */
	/* Turn on quotas so that they are updated correctly */
	for (i = 0; i < MAXQUOTAS; i++) {
	for (i = 0; i < MAXQUOTAS; i++) {
		quota_enabled[i] = 1;
		if (REISERFS_SB(s)->s_qf_names[i]) {
		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)
			if (ret < 0)
				reiserfs_warning(s, "reiserfs-2500",
				reiserfs_warning(s, "reiserfs-2500",
						 "cannot turn on journaled "
						 "cannot turn on journaled "
@@ -304,7 +312,7 @@ static int finish_unfinished(struct super_block *s)
#ifdef CONFIG_QUOTA
#ifdef CONFIG_QUOTA
	/* Turn quotas off */
	/* Turn quotas off */
	for (i = 0; i < MAXQUOTAS; i++) {
	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);
			dquot_quota_off(s, i);
	}
	}
	if (ms_active_set)
	if (ms_active_set)