From: Alex Elder <aelder@sgi.com>
To: Grazvydas Ignotas <notasas@gmail.com>
Cc: <xfs@oss.sgi.com>, <linux-btrfs@vger.kernel.org>
Subject: Re: [PATCH] xfstests: add new getdents test
Date: Fri, 23 Sep 2011 08:56:22 -0500 [thread overview]
Message-ID: <1316786182.2879.8.camel@doink> (raw)
In-Reply-To: <CANOLnOPm+BEQ0QOYnYRkJqpGPwyUD9D+23dJe2OwgrHXqYFyVA@mail.gmail.com>
On Fri, 2011-09-23 at 16:03 +0300, Grazvydas Ignotas wrote:
> On Thu, Sep 22, 2011 at 11:18 PM, Alex Elder <aelder@sgi.com> wrote:
> > On Mon, 2011-09-12 at 03:19 +0300, Grazvydas Ignotas wrote:
> >> The test checks if no duplicate d_off values are returned and that
> >> those values are seekable to the right inodes.
> >>
> >> Signed-off-by: Grazvydas Ignotas <notasas@gmail.com>
> >
> > I have two minor comments on the C program below,
> > but even if you don't want to address them this
> > looks good.
> >
> > Reviewed-by: Alex Elder <aelder@sgi.com>
> >
. . .
> >> +static uint64_t d_off_histoty[HISTORY_LEN];
> >> +static uint64_t d_ino_histoty[HISTORY_LEN];
> >
> > Is "histoty" intentional or a typo?
>
> whoops, it's a typo. I might send a patch for this later.
I will change this for you before committing.
> >
> >> +int
> >> +main(int argc, char *argv[])
. . .
> >> + nread = syscall(SYS_getdents64, fd, buf, BUF_SIZE);
> >
> > You could just use sizeof (struct linux_dirent_64) rather than
> > BUF_SIZE here. I suppose it doesn't hurt but there's no real
> > sense in reading more than the one you're going to look at.
>
> I'm not sure if reading partial entry is allowed, manpage says it may
> fail with EINVAL if buffer size is too small..
I will keep this as-is. I was wrong about the size you should
pass, but my point still stands... For a single entry you need
to pass a buffer big enough to hold a linux_dirent64 structure
*plus* the maximum-sized name that entry could contain. That
appears to be 256 bytes, though POSIX allows more.
Anyway, if you or anyone else wants to try to change this
in the future to read in a smaller amount here, that's fine
but it's not necessary now.
Bottom line, I'll make the change I mentioned above and
will commit the result.
-Alex
prev parent reply other threads:[~2011-09-23 13:56 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-09-12 0:19 [PATCH] xfstests: add new getdents test Grazvydas Ignotas
2011-09-13 12:58 ` Christoph Hellwig
2011-09-22 20:18 ` Alex Elder
2011-09-23 13:03 ` Grazvydas Ignotas
2011-09-23 13:56 ` Alex Elder [this message]
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=1316786182.2879.8.camel@doink \
--to=aelder@sgi.com \
--cc=linux-btrfs@vger.kernel.org \
--cc=notasas@gmail.com \
--cc=xfs@oss.sgi.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).