From: Tomas Hruby <thruby@few.vu.nl>
To: Akshat Aranya <aaranya@cs.sunysb.edu>
Cc: linux-fsdevel@vger.kernel.org
Subject: Re: readdir & bonnie++
Date: Mon, 5 Jun 2006 17:48:04 +0200 [thread overview]
Message-ID: <20060605154804.GA19286@fspc268> (raw)
In-Reply-To: <e48344780606050606v30b4b47as63318f941359e3a2@mail.gmail.com>
> >My problem with bonnie happens in a test which counts how many files where
> >created. It just call readdir in loop and counts how many entries were
> >returned. As far as I understand the bonnie code, there were no files
> >deleted
> >yet.
> >
> >I checked the glibc code (i hope that the correct one) and it seems that
> >the
> >loop inside readdir is returned only if there are no more data in the
> >buffer
> >and so the getdents is called again. My problem is that there SHOULD be the
> >last entry still in the buffer.
> >
>
> So, what you're saying is that the getdents() call actually returns
> the last entry, but readdir() somehow ignores that last entry? If
> that is the case, I would look at the d_off value for that last entry
> for weirdness.
Finally, we found that bug. Thank you all. The problem was that filp->f_pos was
set to a wrong value when EOF was detected. And this value is assigned to
->d_off of the last returned entry after returning from vfs_readdir(). This
value is checked by getdents() in glibc when checking if the kernel structures
are the same as in userspace. The wrong value was 64bit (I forgot to truncate it
to 32bits) whereas the userspace value is 32bit only :(
Tomas
prev parent reply other threads:[~2006-06-05 15:44 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-06-01 23:33 readdir & bonnie++ Tomas Hruby
2006-06-02 15:00 ` Bob Copeland
[not found] ` <e48344780606031942hbc46461q21a03894b83174df@mail.gmail.com>
2006-06-04 9:48 ` Tomas Hruby
2006-06-05 13:06 ` Akshat Aranya
2006-06-05 15:48 ` Tomas Hruby [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=20060605154804.GA19286@fspc268 \
--to=thruby@few.vu.nl \
--cc=aaranya@cs.sunysb.edu \
--cc=linux-fsdevel@vger.kernel.org \
/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