[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <1310957555-15617-4-git-send-email-xiaoqiangnk@gmail.com>
Date: Mon, 18 Jul 2011 10:52:26 +0800
From: Yongqiang Yang <xiaoqiangnk@...il.com>
To: linux-ext4@...r.kernel.org
Cc: aedilger@...il.com, Yongqiang Yang <xiaoqiangnk@...il.com>
Subject: [PATCH 03/12] ext4: prevent a fs without journal from being resized
This patch prevents a fs without journal from being resized, because
it is easy to detroy the fs.
Signed-off-by: Yongqiang Yang <xiaoqiangnk@...il.com>
---
fs/ext4/resize.c | 10 ++++++++++
1 files changed, 10 insertions(+), 0 deletions(-)
diff --git a/fs/ext4/resize.c b/fs/ext4/resize.c
index 53d9795..33ab40d 100644
--- a/fs/ext4/resize.c
+++ b/fs/ext4/resize.c
@@ -33,6 +33,16 @@ int ext4_resize_begin(struct super_block *sb)
return -EPERM;
}
+ /*
+ * We are not allowed to do online-resizing on a filesystem without
+ * journal, otherwise, it is easy to destroy the filesystem.
+ */
+ if (!EXT4_SB(sb)->s_journal) {
+ ext4_warning(sb, "There is no journal for the filesystem, "
+ "so online resizing is not allowed\n");
+ return -EPERM;
+ }
+
if (test_and_set_bit_lock(EXT4_RESIZING, &EXT4_SB(sb)->s_resize_flags))
ret = -EBUSY;
--
1.7.5.1
--
To unsubscribe from this list: send the line "unsubscribe linux-ext4" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Powered by blists - more mailing lists