From: "Lukáš Czerner" <lczerner@redhat.com>
To: Namjae Jeon <namjae.jeon@samsung.com>
Cc: "Theodore Ts'o" <tytso@mit.edu>,
linux-ext4 <linux-ext4@vger.kernel.org>,
Ashish Sangwan <a.sangwan@samsung.com>
Subject: Re: [PATCH] ext4: fix COLLAPSE RANGE test failure when bigalloc is enable
Date: Wed, 4 Jun 2014 15:27:50 +0200 (CEST) [thread overview]
Message-ID: <alpine.LFD.2.00.1406041456210.2927@localhost.localdomain> (raw)
In-Reply-To: <001001cf7fcc$34f3c2c0$9edb4840$@samsung.com>
On Wed, 4 Jun 2014, Namjae Jeon wrote:
> Date: Wed, 04 Jun 2014 17:08:45 +0900
> From: Namjae Jeon <namjae.jeon@samsung.com>
> To: Theodore Ts'o <tytso@mit.edu>
> Cc: linux-ext4 <linux-ext4@vger.kernel.org>,
> Ashish Sangwan <a.sangwan@samsung.com>
> Subject: [PATCH] ext4: fix COLLAPSE RANGE test failure when bigalloc is enable
>
> Blocks in collapse range should be collapsed per cluster unit when bigalloc
> is enable. If bigalloc is not enable, EXT4_CLUSTER_SIZE will be same with
> EXT4_BLOCK_SIZE.
I wonder why it is so ? Bigalloc only affects the way we allocate
and free blocks, it does not affect extent tree at all and so
freeing and allocating extents at the block boundary on bigalloc
file system should be just fine - underlying code should be able to
handle it.
It might be that there is some complication in shift_extent code
which is not obvious to me. Could you please describe the problem
and why this is needed little bit more ?
Have you done some testing with bigalloc enabled file system with
respect to collapse range ?
Thanks!
-Lukas
>
> Signed-off-by: Namjae Jeon <namjae.jeon@samsung.com>
> Signed-off-by: Ashish Sangwan <a.sangwan@samsung.com>
> ---
> fs/ext4/extents.c | 7 ++-----
> 1 file changed, 2 insertions(+), 5 deletions(-)
>
> diff --git a/fs/ext4/extents.c b/fs/ext4/extents.c
> index 4da228a..2b9f5f3 100644
> --- a/fs/ext4/extents.c
> +++ b/fs/ext4/extents.c
> @@ -5403,16 +5403,13 @@ int ext4_collapse_range(struct inode *inode, loff_t offset, loff_t len)
> int ret;
>
> /* Collapse range works only on fs block size aligned offsets. */
> - if (offset & (EXT4_BLOCK_SIZE(sb) - 1) ||
> - len & (EXT4_BLOCK_SIZE(sb) - 1))
> + if (offset & (EXT4_CLUSTER_SIZE(sb) - 1) ||
> + len & (EXT4_CLUSTER_SIZE(sb) - 1))
> return -EINVAL;
>
> if (!S_ISREG(inode->i_mode))
> return -EINVAL;
>
> - if (EXT4_SB(inode->i_sb)->s_cluster_ratio > 1)
> - return -EOPNOTSUPP;
> -
> trace_ext4_collapse_range(inode, offset, len);
>
> punch_start = offset >> EXT4_BLOCK_SIZE_BITS(sb);
>
next prev parent reply other threads:[~2014-06-04 13:27 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-06-04 8:08 [PATCH] ext4: fix COLLAPSE RANGE test failure when bigalloc is enable Namjae Jeon
2014-06-04 13:27 ` Lukáš Czerner [this message]
2014-06-05 8:48 ` Namjae Jeon
2014-06-17 22:09 ` Theodore Ts'o
2014-06-19 4:51 ` Namjae Jeon
2014-07-29 14:47 ` Theodore Ts'o
2014-07-30 4:36 ` Namjae Jeon
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=alpine.LFD.2.00.1406041456210.2927@localhost.localdomain \
--to=lczerner@redhat.com \
--cc=a.sangwan@samsung.com \
--cc=linux-ext4@vger.kernel.org \
--cc=namjae.jeon@samsung.com \
--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