From: Allison Henderson <achender@linux.vnet.ibm.com>
To: Yongqiang Yang <xiaoqiangnk@gmail.com>
Cc: Ext4 Developers List <linux-ext4@vger.kernel.org>,
xfs-oss <xfs@oss.sgi.com>, Dave Chinner <david@fromorbit.com>
Subject: Re: xfsprogs: Fix for xfstest 252 hang on ext4
Date: Tue, 31 May 2011 08:25:53 -0700 [thread overview]
Message-ID: <4DE50881.90401@linux.vnet.ibm.com> (raw)
In-Reply-To: <4DDB1A0C.5030502@linux.vnet.ibm.com>
On 5/23/2011 7:38 PM, Allison Henderson wrote:
> On 5/23/2011 6:16 PM, Yongqiang Yang wrote:
>> On Tue, May 24, 2011 at 4:34 AM, Allison Henderson
>> <achender@linux.vnet.ibm.com> wrote:
>>> Hi all,
>>>
>>> While trying to add more punch hole tests to xfstest, I found that
>>> test 252 hangs on ext4 due to a loop in xfsprogs that does not exit.
>>> XFS gets out of this loop because there is logic in the loop that
>>> looks for the last extent flag and breaks out. But it looks like ext4
>>> does not return a last extent when the file has a hole at the end. I
>>> am not sure if this is the correct behavior or not, so I will copy
>>> the ext4 folks on this too. Below is a copy of the fix for xfsprogs:
>>
>> Hi there,
>>
>> What's blocksize of the tested ext4? For now, ext4 returns
>> LAST_EXTENT if the logical offset covered by the extent is greater
>> than file size, so if there is a hole at the end, no last extent is
>> returned. Thx!
>>
>> Yongqiang.
>
> Hi there,
>
> The block size I've been using is 4096. As long as that behavior is
> expected, I think the test will be ok with just the xfsprogs fix,
> though. Thx!
>
> Allison Henderson
>
>>
>>>
>>> diff --git a/io/fiemap.c b/io/fiemap.c
>>> index fa990cc..81fc92c 100644
>>> --- a/io/fiemap.c
>>> +++ b/io/fiemap.c
>>> @@ -246,7 +246,7 @@ fiemap_f(
>>> flg_w, _("FLAGS"));
>>> }
>>>
>>> - while (!last&& ((cur_extent + 1) != max_extents)) {
>>> + while (!last&& (cur_extent<= max_extents)) {
>>> if (max_extents)
>>> num_extents = min(num_extents,
>>> max_extents - (cur_extent + 1));
>>>
>>>
>>> It looks like the loop enters with last=0, cur_extents=0, and
>>> max_extents = 0, and on the first iteration cur_extents get set to 2,
>>> so we dont see ((cur_extent + 1) == max_extents for a very long time.
>>> I doubt the logic was meant to work that way, so this patch should
>>> fix it, but I wanted to make sure that the fiemap for ext4 is working
>>> as intended too. Feed back appreciated! Thx all!
>>>
>>> Allison Henderson
>>> --
>>> 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
>>>
>>
>>
>>
>
>> Hi all,
>>
>> I haven't heard much back on this patch, so Im just poking this
>> thread to make sure it doesn't get forgotten. I have some patches
>> out there for punch hole, and I'm currently looking at fixing up
>> some older punch hole tests in the dmapi code, but they wont do much
>> good for ext4 with out this fix. If I could get a quick peek from
>> some one on the xfs list for this patch, that would be much
>> appreciated. Thx all!
>
> If ext4 is not setting the last extent flag on the last extent then
> that's an ext4 bug that the test has detected, right? And so you
> should be fixing ext4 rather than modifying the test to hide the
> different behaviour?
>
> Cheer
>
>-- Dave Chinner david@fromorbit.com
Hi All,
Sorry, I should have poked the thread with Yongqiang's response, so I
will move the dialog into this thread. At the moment, it sounds like
the fiemap for ext4 is working as intended. Yongqiang, do you agree
that the fiemap for ext4 should be changed? I think you are more
familiar with this part of the code than I am, and I just want to make
sure we find a solution that everyone is happy with. Thx!
Allison Henderson
> _______________________________________________
> xfs mailing list
> xfs@oss.sgi.com
> http://oss.sgi.com/mailman/listinfo/xfs
next prev parent reply other threads:[~2011-05-31 15:26 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-05-23 20:34 xfsprogs: Fix for xfstest 252 hang on ext4 Allison Henderson
2011-05-24 1:16 ` Yongqiang Yang
2011-05-24 2:38 ` Allison Henderson
2011-05-31 15:25 ` Allison Henderson [this message]
2011-06-01 1:58 ` Yongqiang Yang
2011-06-01 20:50 ` Allison Henderson
2011-05-26 18:32 ` Allison Henderson
2011-05-30 1:25 ` Dave Chinner
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=4DE50881.90401@linux.vnet.ibm.com \
--to=achender@linux.vnet.ibm.com \
--cc=david@fromorbit.com \
--cc=linux-ext4@vger.kernel.org \
--cc=xfs@oss.sgi.com \
--cc=xiaoqiangnk@gmail.com \
/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).