linux-ext4.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] ext4: disable defrag for metadata_csum file systems
@ 2013-04-18 21:58 Theodore Ts'o
  2013-04-18 23:13 ` Zheng Liu
  0 siblings, 1 reply; 5+ messages in thread
From: Theodore Ts'o @ 2013-04-18 21:58 UTC (permalink / raw)
  To: Ext4 Developers List; +Cc: Theodore Ts'o, Darrick J. Wong

It looks like there is absolutely no support for metadata checksums in
fs/ext4/move_extent.c.  So if you try to defrag a file on a
metadata_csum, it leaves the file system corrupted.

We really, really should get this fixed ASAP, but until we do, let's
disable e4defrag on metadata_csum file systems so we avoid corrupting
file systems.

Cc: "Darrick J. Wong" <darrick.wong@oracle.com>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
---
 fs/ext4/ioctl.c | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/fs/ext4/ioctl.c b/fs/ext4/ioctl.c
index 9491ac0..2d043da 100644
--- a/fs/ext4/ioctl.c
+++ b/fs/ext4/ioctl.c
@@ -450,6 +450,15 @@ group_extend_out:
 			goto mext_out;
 		}
 
+		if (EXT4_HAS_RO_COMPAT_FEATURE(inode->i_sb,
+			EXT4_FEATURE_RO_COMPAT_METADATA_CSUM)) {
+			ext4_msg(sb, KERN_ERR,
+				 "Online defrag not supported with "
+				 "metadata_csum");
+			err = -EOPNOTSUPP;
+			goto mext_out;
+		}
+
 		err = mnt_want_write_file(filp);
 		if (err)
 			goto mext_out;
-- 
1.7.12.rc0.22.gcdd159b


^ permalink raw reply related	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2013-04-19  6:19 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-04-18 21:58 [PATCH] ext4: disable defrag for metadata_csum file systems Theodore Ts'o
2013-04-18 23:13 ` Zheng Liu
2013-04-19  5:47   ` Darrick J. Wong
2013-04-19  6:17     ` Theodore Ts'o
2013-04-19  6:19       ` Theodore Ts'o

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).