From: "Darrick J. Wong" <darrick.wong@oracle.com>
To: Eric Whitney <enwlinux@gmail.com>
Cc: linux-ext4@vger.kernel.org, tytso@mit.edu
Subject: Re: [PATCH] ext4: make online defrag error reporting consistent
Date: Wed, 17 Jun 2015 10:15:32 -0700 [thread overview]
Message-ID: <20150617171532.GE7063@birch.djwong.org> (raw)
In-Reply-To: <20150617164035.GA1746@localhost.localdomain>
On Wed, Jun 17, 2015 at 12:40:35PM -0400, Eric Whitney wrote:
> Make the error reporting behavior resulting from the unsupported use
> of online defrag on files with data journaling enabled consistent with
> that implemented for bigalloc file systems. Difference found with
> ext4/308.
>
> Signed-off-by: Eric Whitney <enwlinux@gmail.com>
> ---
> fs/ext4/move_extent.c | 10 +++++++---
> 1 file changed, 7 insertions(+), 3 deletions(-)
>
> diff --git a/fs/ext4/move_extent.c b/fs/ext4/move_extent.c
> index 8c04afb..fb6f117 100644
> --- a/fs/ext4/move_extent.c
> +++ b/fs/ext4/move_extent.c
> @@ -571,12 +571,16 @@ ext4_move_extents(struct file *o_filp, struct file *d_filp, __u64 orig_blk,
> orig_inode->i_ino, donor_inode->i_ino);
> return -EINVAL;
> }
> - /* TODO: This is non obvious task to swap blocks for inodes with full
> - jornaling enabled */
> +
> + /* TODO: it's not obvious how to swap blocks for inodes with full
> + journaling enabled */
> if (ext4_should_journal_data(orig_inode) ||
> ext4_should_journal_data(donor_inode)) {
> - return -EINVAL;
> + ext4_msg(orig_inode->i_sb, KERN_ERR,
> + "Online defrag not supported with data journaling");
> + return -EOPNOTSUPP;
> }
> +
One minor nit: If it's solely the donor_inode that's data=journal (i.e. we
didn't mount with data=journal and only the donor inode is chattr +j), the
inode number reported in the message will be inaccurate.
I'm not sure why you'd chattr +j only the donor inode, so in practice this
isn't likely to occur.
Other than that,
Reviewed-by: Darrick J. Wong <darrick.wong@oracle.com>
--D
> /* Protect orig and donor inodes against a truncate */
> lock_two_nondirectories(orig_inode, donor_inode);
>
> --
> 2.1.4
>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-ext4" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
next prev parent reply other threads:[~2015-06-17 17:15 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-06-17 16:40 [PATCH] ext4: make online defrag error reporting consistent Eric Whitney
2015-06-17 17:15 ` Darrick J. Wong [this message]
2015-06-17 18:02 ` Eric Whitney
2015-06-17 18:04 ` Darrick J. Wong
2015-06-22 1:43 ` 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=20150617171532.GE7063@birch.djwong.org \
--to=darrick.wong@oracle.com \
--cc=enwlinux@gmail.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 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).