From: Theodore Ts'o <tytso@mit.edu>
To: basile@opensource.dyc.edu
Cc: linux-ext4@vger.kernel.org, "Anthony G. Basile" <blueness@gentoo.org>
Subject: Re: [PATCH] misc/e4defrag.c: use posix_fallocate64() if fallocate64() is unavailable
Date: Thu, 31 Jul 2014 19:22:53 -0400 [thread overview]
Message-ID: <20140731232253.GF1566@thunk.org> (raw)
In-Reply-To: <1406830068-6485-1-git-send-email-basile@opensource.dyc.edu>
On Thu, Jul 31, 2014 at 02:07:48PM -0400, basile@opensource.dyc.edu wrote:
> From: "Anthony G. Basile" <blueness@gentoo.org>
>
> Commit 58229aaf removed the broken fallback syscall for fallocate64() on systems
> where the latter is unavailable. However, it did not provide a substitute,
> so the build fails on uClibc which does not have fallocate64(), but does have
> posix_fallocate64(). Since fallocate64() is called with mode=0, we can make use
> of posix_fallocate64() on such systems.
The posix_fallocate[64]() is not the same as fallocate[64](). Some
libc's will implement posix_fallocate() by brute force writing zeros
to the file. Some will try calling the fallocate(2) system call if it
is present, and then fall back to the brute force write. With
fallocate(2), if the file system returns ENOTSUPP, userspace gets told
about it.
So one question is how has uClibc actually implemented with
posix_fallocate[64]()? Does it implement fallocate()? I'd be happier
falling back to fallocate() and simply failing to support files which
are larger than the maximum size supported by off_t.
Yet another possibility is simply changing the Makefile to simply skip
building e4defrag if the C library doesn't support the fallocate
system call.
- Ted
next prev parent reply other threads:[~2014-07-31 23:22 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-07-31 18:07 [PATCH] misc/e4defrag.c: use posix_fallocate64() if fallocate64() is unavailable basile
2014-07-31 23:22 ` Theodore Ts'o [this message]
2014-08-06 13:56 ` Anthony G. Basile
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=20140731232253.GF1566@thunk.org \
--to=tytso@mit.edu \
--cc=basile@opensource.dyc.edu \
--cc=blueness@gentoo.org \
--cc=linux-ext4@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