From: Baruch Siach <baruch@tkos.co.il>
To: Theodore Ts'o <tytso@mit.edu>
Cc: linux-ext4@vger.kernel.org
Subject: Re: [PATCH] e4defrag: fix build when posix_fadvise is missing
Date: Thu, 2 Jan 2014 08:49:00 +0200 [thread overview]
Message-ID: <20140102064900.GJ6589@tarshish> (raw)
In-Reply-To: <20140101204650.GE17519@thunk.org>
Hi Ted,
On Wed, Jan 01, 2014 at 03:46:50PM -0500, Theodore Ts'o wrote:
> On Wed, Jan 01, 2014 at 09:08:00PM +0200, Baruch Siach wrote:
> > Yes. uClibc does provide posix_fadvise64() when __NR_fadvise64_64 is
> > available.
> >
> > > Maybe the better fix would be to try to use posix_fadvise64 if it is exists,
> > > with posix_fadvise() and the locally defined posix_fadvise() as fallbacks.
> >
> > OK. So you suggest to add another autoconf test for posix_fadvise64 and use
> > that as a fall back before trying direct syscall()?
>
> Yes, I think that's the more general and hence the more correct
> answer. In fact what we have right now is arguably wrong, since on a
> 32-bit platform where off_t is 32-bits, and which defines
> posix_fadvise, we wouldn't correctly handle files that are larger than
> 2GB. So if posix_fadvise64 exists, we should be using in preference
> to posix_fadvise(), even if both are provided by the C library.
>
> Would you mind sending such a revised patch?
Just sent. Thanks for reviewing.
Turns out that this is actually an uClibc bug. There used to be a
posix_fadvise definition for xtensa as a wrapper around the __NR_fadvise64_64
system call. This broke with uClibc commit ee84b8b400 (linux: posix_fadvise:
use new SYSCALL_ALIGN_64BIT). The patch I have sent can be used as a
workaround for now. I'll send a separate patch for uClibc later.
baruch
--
http://baruch.siach.name/blog/ ~. .~ Tk Open Systems
=}------------------------------------------------ooO--U--Ooo------------{=
- baruch@tkos.co.il - tel: +972.2.679.5364, http://www.tkos.co.il -
prev parent reply other threads:[~2014-01-02 6:49 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-01-01 10:28 [PATCH] e4defrag: fix build when posix_fadvise is missing Baruch Siach
2014-01-01 17:22 ` Theodore Ts'o
2014-01-01 17:31 ` Baruch Siach
2014-01-01 17:37 ` Theodore Ts'o
2014-01-01 19:08 ` Baruch Siach
2014-01-01 20:46 ` Theodore Ts'o
2014-01-02 6:49 ` Baruch Siach [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=20140102064900.GJ6589@tarshish \
--to=baruch@tkos.co.il \
--cc=linux-ext4@vger.kernel.org \
--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;
as well as URLs for NNTP newsgroup(s).