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, 07 Dec 2011 11:42:08 +0000 Message-ID: <4EDF5110.8090304@draigBrady.com> References: <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> <4ED655AF.7000503@draigBrady.com> <20111130170116.GA6154@thunk.org> <4ED6C644.4060906@draigBrady.com> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: QUOTED-PRINTABLE To: linux-fsdevel@vger.kernel.org Return-path: Received: from mail2.vodafone.ie ([213.233.128.44]:10298 "EHLO mail2.vodafone.ie" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755139Ab1LGLmK (ORCPT ); Wed, 7 Dec 2011 06:42:10 -0500 In-Reply-To: <4ED6C644.4060906@draigBrady.com> Sender: linux-fsdevel-owner@vger.kernel.org List-ID: On 12/01/2011 12:11 AM, P=E1draig Brady wrote: > On 11/30/2011 05:01 PM, Ted Ts'o wrote: >> On Wed, Nov 30, 2011 at 04:11:27PM +0000, P=E1draig Brady wrote: >>> 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 A= LLOCSP. >>> I think the specialised alignment behavior should be restricted to >>> direct calls to XFS_IOC_ALLOCSP to be called by xfs_mkfile(1) or wh= atever. >>> Better would be to provide generic access to that functionality >>> through an ALIGN option to fallocate() >> >> Well, XFS_IOC_RESVSP is the same as fallocate with the >> FALLOC_FL_KEEP_SIZE flag. That is to say, blocks are allocated and >> attached to the inode --- that is, which blocks out of the pool of >> free blocks should be selected is decided at the time that you call >> fallocate() with the KEEP_SIZE flag or use the XFS_IOC_RESVSP ioctl >> (which by the way works on any file system that supports fallocate o= n >> modern kernels --- the kernel provides the translation from >> XFS_IOC_RESVSP to fallocate/KEEP_SIZE in fs/ioctl.c's >> ioctl_preallocate() function.) >=20 > Thanks for the clarification. > My main point is that these related ioctls existed before fallocate. >=20 >> What Dave was talking about is something different. He's suggesting= a >> new call which reserves space, but which does not actually make the >> block allocation decision until the time of the write. >=20 > Yes that was clear. > I'm still not sure it's needed TBH. > The separation of functionality is needed for the reasons Dave detail= ed, > but it might be better to add an ALIGN flag to fallocate for > that special use case. > I'm not trying to enforce my argument with repetition here, > just trying to be clear. Is XFS the only file system that overloads this alignment behavior on f= allocate()? Why I ask, is because if that was the case, then perhaps XFS could chan= ge to using the FALLOC_FL_ALIGN flag for this (or its existing ioctl), and= so would not be negatively impacted by tools which start using fallocate()= , unaware of the subtle performance implications on XFS. 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