[Ocfs2-tools-devel] [PATCH 4/5] fsck.ocfs2: Skip recreating quota files when run in RO mode

Sunil Mushran sunil.mushran at oracle.com
Thu Feb 9 16:54:26 PST 2012


When run in readonly mode, pass5 should not attempt to recreate
the quota files.

Signed-off-by: Sunil Mushran <sunil.mushran at oracle.com>
---
 fsck.ocfs2/pass5.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/fsck.ocfs2/pass5.c b/fsck.ocfs2/pass5.c
index 065fee8..114d289 100644
--- a/fsck.ocfs2/pass5.c
+++ b/fsck.ocfs2/pass5.c
@@ -500,7 +500,7 @@ errcode_t o2fsck_pass5(o2fsck_state *ost)
 		com_err(whoami, ret, "while computing quota usage");
 		goto out;
 	}
-	if (has_usrquota) {
+	if (has_usrquota && ost->ost_fs->fs_flags & OCFS2_FLAG_RW) {
 		ret = recreate_quota_files(fs, USRQUOTA);
 		if (ret)
 			goto out;
@@ -510,7 +510,7 @@ errcode_t o2fsck_pass5(o2fsck_state *ost)
 			goto out;
 		}
 	}
-	if (has_grpquota) {
+	if (has_grpquota && ost->ost_fs->fs_flags & OCFS2_FLAG_RW) {
 		ret = recreate_quota_files(fs, GRPQUOTA);
 		if (ret)
 			goto out;
-- 
1.7.7.6




More information about the Ocfs2-tools-devel mailing list