From mboxrd@z Thu Jan 1 00:00:00 1970
From: =?ISO-8859-1?Q?P=E1draig_Brady?=
Subject: Re: fallocate vs ENOSPC
Date: Wed, 30 Nov 2011 16:11:27 +0000
Message-ID: <4ED655AF.7000503@draigBrady.com>
References: <20111125104050.GA26729@infradead.org> <20111127031455.GK5167@thunk.org> <20111127234331.GW2386@dastard> <20111128051054.GZ2386@dastard> <4ED34C66.8050300@draigBrady.com> <20111129002432.GA2386@dastard> <4ED4E824.4030107@draigBrady.com> <20111129233729.GS7046@dastard> <4ED5F740.8090005@draigBrady.com> <20111130153202.GA9251@thunk.org>
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: QUOTED-PRINTABLE
Cc: Dave Chinner ,
Christoph Hellwig ,
linux-fsdevel@vger.kernel.org
To: Ted Ts'o
Return-path:
Received: from mail3.vodafone.ie ([213.233.128.45]:4118 "EHLO
mail3.vodafone.ie" rhost-flags-OK-OK-OK-OK) by vger.kernel.org
with ESMTP id S1754360Ab1K3QLb (ORCPT
);
Wed, 30 Nov 2011 11:11:31 -0500
In-Reply-To: <20111130153202.GA9251@thunk.org>
Sender: linux-fsdevel-owner@vger.kernel.org
List-ID:
On 11/30/2011 03:32 PM, Ted Ts'o wrote:
> On Wed, Nov 30, 2011 at 09:28:32AM +0000, P=E1draig Brady wrote:
>>
>> But then posix_fallocate() would always be slow I think,
>> requiring one to actually write the NULs.
>=20
> Almost no one should ever use posix_fallocate(); it's can be a
> performance disaster because you don't know whether or not the file
> system will really do fallocate, or will do the slow "write zeros"
> thing.
>=20
> You really should use fallocate(), take the failure if the file syste=
m
> doesn't support fallocate, and then you can decide what the
> appropriate thing to do might be.
s/posix_fallocate()/functionality provided by &/
I.E. copy --sparse=3Dnever could use that,
and it would be beneficial if it was as fast as possible.
I looked for a couple of minutes on the XFS preallocate behaviour,
and it seems that these ioctls pre date fallocate().
http://linux.die.net/man/3/xfsctl
I see XFS_IOC_ALLOCSP and XFS_IOC_RESVSP.
So fallocate() support was directly mapped on top of the existing ALLOC=
SP.
I think the specialised alignment behavior should be restricted to
direct calls to XFS_IOC_ALLOCSP to be called by xfs_mkfile(1) or whatev=
er.
Better would be to provide generic access to that functionality
through an ALIGN option to fallocate()
cheers,
P=E1draig.
--
To unsubscribe from this list: send the line "unsubscribe linux-fsdevel=
" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html