[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CA+55aFzJW70YApg8ra-c79E-j1ujOXbh=26k2dvyYX+qZuu_8A@mail.gmail.com>
Date:	Fri, 4 Mar 2016 19:13:25 -0800
From:	Linus Torvalds <torvalds@...ux-foundation.org>
To:	"Darrick J. Wong" <darrick.wong@...cle.com>
Cc:	Jens Axboe <axboe@...nel.dk>,
	Christoph Hellwig <hch@...radead.org>,
	"Theodore Ts'o" <tytso@....edu>,
	"Martin K. Petersen" <martin.petersen@...cle.com>,
	Linux API <linux-api@...r.kernel.org>,
	Dave Chinner <david@...morbit.com>,
	Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
	shane.seymour@....com, Bruce Fields <bfields@...ldses.org>,
	linux-fsdevel <linux-fsdevel@...r.kernel.org>,
	Jeff Layton <jlayton@...chiereds.net>,
	Andrew Morton <akpm@...ux-foundation.org>
Subject: Re: [PATCH 3/3] block: implement (some of) fallocate for block devices
On Fri, Mar 4, 2016 at 4:56 PM, Darrick J. Wong <darrick.wong@...cle.com> wrote:
> +
> +       /* We can't change the bdev size from here */
> +       if (!(mode & FALLOC_FL_KEEP_SIZE))
> +               return -EOPNOTSUPP;
Oh, and this I think is wrong.
The thing is, FALLOC_FL_KEEP_SIZE is only supposed to matter if the
region is outside the existing length.
So if y ou punch a hole in the middle of a file, you don't need
FALLOC_FL_KEEP_SIZE.
I would suggest removing this check entirely, since you already check
that people don't try to punch holes past the end of the device. So
FALLOC_FL_KEEP_SIZE is simply a non-issue, and shouldn't even be
checked.
              Linus
Powered by blists - more mailing lists
 
