From mboxrd@z Thu Jan 1 00:00:00 1970 From: Theodore Ts'o Subject: Re: [PATCH v5 1/10] fs: Add new flag(FALLOC_FL_COLLAPSE_RANGE) for fallocate Date: Sat, 22 Feb 2014 09:06:25 -0500 Message-ID: <20140222140625.GD26637@thunk.org> References: <1392741464-20029-1-git-send-email-linkinjeon@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Cc: jack@suse.cz, Namjae Jeon , linux-kernel@vger.kernel.org, xfs@oss.sgi.com, bpm@sgi.com, adilger.kernel@dilger.ca, mtk.manpages@gmail.com, Ashish Sangwan , linux-fsdevel@vger.kernel.org, lczerner@redhat.com, linux-ext4@vger.kernel.org, viro@zeniv.linux.org.uk To: Namjae Jeon Return-path: Content-Disposition: inline In-Reply-To: <1392741464-20029-1-git-send-email-linkinjeon@gmail.com> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: xfs-bounces@oss.sgi.com Sender: xfs-bounces@oss.sgi.com List-Id: linux-ext4.vger.kernel.org On Wed, Feb 19, 2014 at 01:37:43AM +0900, Namjae Jeon wrote: > + /* > + * There is no need to overlap collapse range with EOF, in which case > + * it is effectively a truncate operation > + */ > + if ((mode & FALLOC_FL_COLLAPSE_RANGE) && > + (offset + len >= i_size_read(inode))) > + return -EINVAL; > + I wonder if we should just translate a collapse range that is equivalent to a truncate operation to, in fact, be a truncate operation? - Ted _______________________________________________ xfs mailing list xfs@oss.sgi.com http://oss.sgi.com/mailman/listinfo/xfs From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751663AbaBVOGi (ORCPT ); Sat, 22 Feb 2014 09:06:38 -0500 Received: from imap.thunk.org ([74.207.234.97]:32829 "EHLO imap.thunk.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750880AbaBVOGg (ORCPT ); Sat, 22 Feb 2014 09:06:36 -0500 Date: Sat, 22 Feb 2014 09:06:25 -0500 From: "Theodore Ts'o" To: Namjae Jeon Cc: viro@zeniv.linux.org.uk, david@fromorbit.com, bpm@sgi.com, adilger.kernel@dilger.ca, jack@suse.cz, mtk.manpages@gmail.com, lczerner@redhat.com, linux-fsdevel@vger.kernel.org, xfs@oss.sgi.com, linux-ext4@vger.kernel.org, linux-kernel@vger.kernel.org, Namjae Jeon , Ashish Sangwan Subject: Re: [PATCH v5 1/10] fs: Add new flag(FALLOC_FL_COLLAPSE_RANGE) for fallocate Message-ID: <20140222140625.GD26637@thunk.org> Mail-Followup-To: Theodore Ts'o , Namjae Jeon , viro@zeniv.linux.org.uk, david@fromorbit.com, bpm@sgi.com, adilger.kernel@dilger.ca, jack@suse.cz, mtk.manpages@gmail.com, lczerner@redhat.com, linux-fsdevel@vger.kernel.org, xfs@oss.sgi.com, linux-ext4@vger.kernel.org, linux-kernel@vger.kernel.org, Namjae Jeon , Ashish Sangwan References: <1392741464-20029-1-git-send-email-linkinjeon@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1392741464-20029-1-git-send-email-linkinjeon@gmail.com> User-Agent: Mutt/1.5.21 (2010-09-15) X-SA-Exim-Connect-IP: X-SA-Exim-Mail-From: tytso@thunk.org X-SA-Exim-Scanned: No (on imap.thunk.org); SAEximRunCond expanded to false Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Feb 19, 2014 at 01:37:43AM +0900, Namjae Jeon wrote: > + /* > + * There is no need to overlap collapse range with EOF, in which case > + * it is effectively a truncate operation > + */ > + if ((mode & FALLOC_FL_COLLAPSE_RANGE) && > + (offset + len >= i_size_read(inode))) > + return -EINVAL; > + I wonder if we should just translate a collapse range that is equivalent to a truncate operation to, in fact, be a truncate operation? - Ted