From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jeremy Allison Subject: Re: fallocate vs ENOSPC Date: Tue, 29 Nov 2011 15:04:37 -0800 Message-ID: <20111129230437.GA3241@samba2> References: <20111127031455.GK5167@thunk.org> <20111127234331.GW2386@dastard> <20111128051054.GZ2386@dastard> <4ED34C66.8050300@draigBrady.com> <4ED39FE2.7010609@draigBrady.com> <20111128202934.GE4348@thunk.org> <20111128204938.GB12171@samba2> <4ED55F0C.7060003@sandeen.net> Reply-To: Jeremy Allison Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: QUOTED-PRINTABLE Cc: Jeremy Allison , Ted Ts'o , =?iso-8859-1?Q?P=E1draig?= Brady , Dave Chinner , Christoph Hellwig , linux-fsdevel@vger.kernel.org To: Eric Sandeen Return-path: Received: from fn.samba.org ([216.83.154.106]:53768 "EHLO lists.samba.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752552Ab1K2XEk (ORCPT ); Tue, 29 Nov 2011 18:04:40 -0500 Content-Disposition: inline In-Reply-To: <4ED55F0C.7060003@sandeen.net> Sender: linux-fsdevel-owner@vger.kernel.org List-ID: On Tue, Nov 29, 2011 at 04:39:08PM -0600, Eric Sandeen wrote: > On 11/28/11 2:49 PM, Jeremy Allison wrote: > > On Mon, Nov 28, 2011 at 03:29:34PM -0500, Ted Ts'o wrote: > >> On Mon, Nov 28, 2011 at 02:51:14PM +0000, P=E1draig Brady wrote: > >>> It would be better to indicate ENOSPC _before_ copying a (potenti= ally large) > >>> file to a (potentially slow) device. If the implementation comple= xity > >>> and side effects of doing this are sufficiently small, then it's = worth > >>> doing. These discussions are to quantify the side effects. > >> > >> In that case, why not use statfs(2) as a first class approximation= ? > >> You won't know for user how much fs metadata will be required, but= for > >> the common case where someone trying to fit 10 pounds of horse man= ure > >> in a 5 pound bag, that can be caught very readily without needing = to > >> use fallocate(2). > >=20 > > Yeah, we do that too, if the fallocate call fails. >=20 > That seems backwards to me; if fallocate fails, statfs(2) isn't going > to reveal more space, is it? (modulo metadata issues, anyway?) It might if fallocate fails with ENOSYS :-). -- 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