|
|
Subscribe / Log in / New account

Re: [PATCH v5 1/10] fs: Add new flag(FALLOC_FL_COLLAPSE_RANGE) for fallocate

From:  Dave Chinner <david-AT-fromorbit.com>
To:  Theodore Ts'o <tytso-AT-mit.edu>, Namjae Jeon <linkinjeon-AT-gmail.com>, viro-AT-zeniv.linux.org.uk, bpm-AT-sgi.com, adilger.kernel-AT-dilger.ca, jack-AT-suse.cz, mtk.manpages-AT-gmail.com, lczerner-AT-redhat.com, linux-fsdevel-AT-vger.kernel.org, xfs-AT-oss.sgi.com, linux-ext4-AT-vger.kernel.org, linux-kernel-AT-vger.kernel.org, Namjae Jeon <namjae.jeon-AT-samsung.com>, Ashish Sangwan <a.sangwan-AT-samsung.com>
Subject:  Re: [PATCH v5 1/10] fs: Add new flag(FALLOC_FL_COLLAPSE_RANGE) for fallocate
Date:  Mon, 24 Feb 2014 08:36:06 +1100
Message-ID:  <20140223213606.GE4317@dastard>
Archive‑link:  Article

On Sat, Feb 22, 2014 at 09:06:25AM -0500, Theodore Ts'o wrote:
> 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?

Trying to collapse a range that extends beyond EOF, IMO, is likely
to only happen if the DVR/NLE application is buggy. Hence I think
that telling the application it is doing something that is likely to
be wrong is better than silently truncating the file....

Cheers,

Dave.
-- 
Dave Chinner
david@fromorbit.com

_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs




to post comments


Copyright © 2014, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds