From: Tao Ma <tm@tao.ma>
To: Zach Brown <zab@redhat.com>
Cc: linux-ext4@vger.kernel.org
Subject: Re: [PATCH 1/2] ext4: Return proper offset for '..' if inline_data enabled.
Date: Fri, 29 Mar 2013 09:34:58 +0800 [thread overview]
Message-ID: <5154EFC2.4010800@tao.ma> (raw)
In-Reply-To: <20130328183332.GE16651@lenny.home.zabbo.net>
On 03/29/2013 02:33 AM, Zach Brown wrote:
> On Thu, Mar 28, 2013 at 06:34:58PM +0800, Tao Ma wrote:
>> From: Tao Ma <boyu.mt@taobao.com>
>>
>> Zach reported a problem that if inline data is enabled, we don't
>> tell the difference between the offset of '.' and '..'. And a
>> getdents will fail if the user only want to get '.'.
>>
>> This patch adds a new offset EXT4_INLINE_DOTDOT_OFFSET which
>> indicates the offset of inline "..", and now 0 is for the "."
>> and EXT4_INLINE_DOTDOT_OFFSET is for "..".
>
> Yeah, this fixes the problem. I confirmed that my little test that got
> a single dirent from getdents() now properly sees . and .. and exits
> rather than spinning.
>
> Tested-by: Zach Brown <zab@redhat.com>
>
>>
>> + if (filp->f_pos == EXT4_INLINE_DOTDOT_OFFSET) {
>> error = filldir(dirent, "..", 2, 0, parent_ino,
>> DT_DIR);
>> if (error)
>> --
>> 1.7.0.4
>
> Though I think you should change the fourth argument (offset) of the
> second flildir() from 0 to EXT4_INLINE_DOTDOT_OFFSET.
My fault, will change it in the next version.
Thanks,
Tao
next prev parent reply other threads:[~2013-03-29 1:35 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-03-28 10:34 [PATCH 1/2] ext4: Return proper offset for '..' if inline_data enabled Tao Ma
2013-03-28 10:34 ` [PATCH 2/2] ext4: Handle readdir when a file is converted from inline to block based Tao Ma
2013-03-28 18:44 ` Zach Brown
2013-03-29 2:03 ` Tao Ma
2013-03-28 18:33 ` [PATCH 1/2] ext4: Return proper offset for '..' if inline_data enabled Zach Brown
2013-03-29 1:34 ` Tao Ma [this message]
2013-04-08 17:11 ` 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=5154EFC2.4010800@tao.ma \
--to=tm@tao.ma \
--cc=linux-ext4@vger.kernel.org \
--cc=zab@redhat.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).