All of lore.kernel.org
 help / color / mirror / Atom feed
From: Zheng Liu <gnehzuil.liu@gmail.com>
To: Theodore Ts'o <tytso@mit.edu>
Cc: Ext4 Developers List <linux-ext4@vger.kernel.org>,
	"Darrick J. Wong" <darrick.wong@oracle.com>
Subject: Re: [PATCH] ext4: disable defrag for metadata_csum file systems
Date: Fri, 19 Apr 2013 07:13:10 +0800	[thread overview]
Message-ID: <51707E06.2050105@gmail.com> (raw)
In-Reply-To: <1366322282-4673-1-git-send-email-tytso@mit.edu>

[Sorry, it seems that I got a delivery error.  So send again]

On 04/19/2013 05:58 AM, Theodore Ts'o wrote:
> 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>

Yes, I also notice this problem.  So currently it seems that the best
choice is to disable defrag for metadata_csum.

Reviewed-By: Zheng Liu <wenqing.lz@taobao.com>

Thanks,
						- Zheng

> ---
>  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;
> 


  reply	other threads:[~2013-04-18 23:13 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-04-18 21:58 [PATCH] ext4: disable defrag for metadata_csum file systems Theodore Ts'o
2013-04-18 23:13 ` Zheng Liu [this message]
2013-04-19  5:47   ` Darrick J. Wong
2013-04-19  6:17     ` Theodore Ts'o
2013-04-19  6:19       ` Theodore Ts'o

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=51707E06.2050105@gmail.com \
    --to=gnehzuil.liu@gmail.com \
    --cc=darrick.wong@oracle.com \
    --cc=linux-ext4@vger.kernel.org \
    --cc=tytso@mit.edu \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.