From mboxrd@z Thu Jan 1 00:00:00 1970 From: =?ISO-8859-1?Q?P=E1draig_Brady?= Subject: Re: fallocate vs ENOSPC Date: Mon, 28 Nov 2011 14:51:14 +0000 Message-ID: <4ED39FE2.7010609@draigBrady.com> References: <4ECF6D41.2040801@draigBrady.com> <20111125104050.GA26729@infradead.org> <20111127031455.GK5167@thunk.org> <20111127234331.GW2386@dastard> <20111128051054.GZ2386@dastard> <4ED34C66.8050300@draigBrady.com> 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: Theodore Tso Return-path: Received: from mail1.vodafone.ie ([213.233.128.43]:15654 "EHLO mail1.vodafone.ie" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750795Ab1K1Ovj (ORCPT ); Mon, 28 Nov 2011 09:51:39 -0500 In-Reply-To: Sender: linux-fsdevel-owner@vger.kernel.org List-ID: On 11/28/2011 02:36 PM, Theodore Tso wrote: >=20 > On Nov 28, 2011, at 3:55 AM, P=E1draig Brady wrote: >=20 >> >> You lucidly detailed issues with 1. which I suppose could be somewha= t >> mitigated by not fallocating < say 1MB, though I suppose file system= s >> could be smarter here and not preallocate small chunks (or when >> otherwise not appropriate). We can already get ENOSPC from a write() >> after an fallocate() in certain edge cases, so it would probably mak= e >> sense to expand those cases. >=20 > I'm curious -- why are you so worried about ENOSPC? >=20 > You need to check the error returns on write(2) anyway (and it's good > programming practice anyways --- don't forget to check on close becau= se > some network file systems only push to the network on close, and in > some cases they might only get quota errors on the close), so I don't= see > why using fallocate() to get an early ENOSPC is so interesting for yo= u. It would be better to indicate ENOSPC _before_ copying a (potentially l= arge) file to a (potentially slow) device. If the implementation complexity and side effects of doing this are sufficiently small, then it's worth doing. These discussions are to quantify the side effects. cheers, P=E1draig. p.s. You can be sure that `cp` deals with errors from write() and close= (). -- 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