Re: [PATCH 1/3] fs: Introduce new flag FALLOC_FL_COLLAPSE_RANGE

2013-08-01 Thread Dave Chinner
On Thu, Aug 01, 2013 at 02:07:39PM +0900, Namjae Jeon wrote: > 2013/8/1, Dave Chinner : > > On Wed, Jul 31, 2013 at 11:42:00PM +0900, Namjae Jeon wrote: > >> From: Namjae Jeon > >> > >> Fallocate now supports new FALLOC_FL_COLLAPSE_RANGE flag. > >> The semantics of this flag are following: > >> 1)

Re: [PATCH 1/3] fs: Introduce new flag FALLOC_FL_COLLAPSE_RANGE

2013-07-31 Thread Namjae Jeon
2013/8/1, Dave Chinner : > On Wed, Jul 31, 2013 at 11:42:00PM +0900, Namjae Jeon wrote: >> From: Namjae Jeon >> >> Fallocate now supports new FALLOC_FL_COLLAPSE_RANGE flag. >> The semantics of this flag are following: >> 1) It collapses the range lying between offset and length by removing any >>

Re: [PATCH 1/3] fs: Introduce new flag FALLOC_FL_COLLAPSE_RANGE

2013-07-31 Thread Dave Chinner
On Thu, Aug 01, 2013 at 12:06:05AM -0400, Theodore Ts'o wrote: > On Thu, Aug 01, 2013 at 12:59:14PM +1000, Dave Chinner wrote: > > > > This funtionality is not introducing any new problems w.r.t. mmap(). > > In terms of truncating a mmap'd file, that can already occur and > > the behaviour is well

Re: [PATCH 1/3] fs: Introduce new flag FALLOC_FL_COLLAPSE_RANGE

2013-07-31 Thread Theodore Ts'o
On Thu, Aug 01, 2013 at 12:59:14PM +1000, Dave Chinner wrote: > > This funtionality is not introducing any new problems w.r.t. mmap(). > In terms of truncating a mmap'd file, that can already occur and > the behaviour is well known. That's not race I'm worried about. Consider the following scena

Re: [PATCH 1/3] fs: Introduce new flag FALLOC_FL_COLLAPSE_RANGE

2013-07-31 Thread Dave Chinner
On Wed, Jul 31, 2013 at 09:07:52PM -0400, Theodore Ts'o wrote: > On Thu, Aug 01, 2013 at 10:54:47AM +1000, Dave Chinner wrote: > > > It's not just the range that it's operating on, but also the region > > > beyond the range that's been collapsed out. > > > > Yes, that's part of "the range that it

Re: [PATCH 1/3] fs: Introduce new flag FALLOC_FL_COLLAPSE_RANGE

2013-07-31 Thread Theodore Ts'o
On Thu, Aug 01, 2013 at 10:54:47AM +1000, Dave Chinner wrote: > > It's not just the range that it's operating on, but also the region > > beyond the range that's been collapsed out. > > Yes, that's part of "the range that it is operating over". > > > A quick eyeball of the patch didn't seem to sh

Re: [PATCH 1/3] fs: Introduce new flag FALLOC_FL_COLLAPSE_RANGE

2013-07-31 Thread Dave Chinner
On Wed, Jul 31, 2013 at 08:46:45PM -0400, Theodore Ts'o wrote: > On Thu, Aug 01, 2013 at 10:23:41AM +1000, Dave Chinner wrote: > > On Wed, Jul 31, 2013 at 06:01:54PM -0400, Theodore Ts'o wrote: > > > Have you considered what happens if you have a 10 megabyte file, of > > > which the first 5 megs ar

Re: [PATCH 1/3] fs: Introduce new flag FALLOC_FL_COLLAPSE_RANGE

2013-07-31 Thread Theodore Ts'o
On Thu, Aug 01, 2013 at 10:23:41AM +1000, Dave Chinner wrote: > On Wed, Jul 31, 2013 at 06:01:54PM -0400, Theodore Ts'o wrote: > > Have you considered what happens if you have a 10 megabyte file, of > > which the first 5 megs are mmap'ed into a userspace process. > > > > Now suppose you call COLLA

Re: [PATCH 1/3] fs: Introduce new flag FALLOC_FL_COLLAPSE_RANGE

2013-07-31 Thread Dave Chinner
On Wed, Jul 31, 2013 at 06:01:54PM -0400, Theodore Ts'o wrote: > Have you considered what happens if you have a 10 megabyte file, of > which the first 5 megs are mmap'ed into a userspace process. > > Now suppose you call COLLAPASE_RANGE on a one megabyte range starting > at offset 1024k from the b

Re: [PATCH 1/3] fs: Introduce new flag FALLOC_FL_COLLAPSE_RANGE

2013-07-31 Thread Dave Chinner
On Wed, Jul 31, 2013 at 11:42:00PM +0900, Namjae Jeon wrote: > From: Namjae Jeon > > Fallocate now supports new FALLOC_FL_COLLAPSE_RANGE flag. > The semantics of this flag are following: > 1) It collapses the range lying between offset and length by removing any data >blocks which are present

Re: [PATCH 1/3] fs: Introduce new flag FALLOC_FL_COLLAPSE_RANGE

2013-07-31 Thread Theodore Ts'o
Have you considered what happens if you have a 10 megabyte file, of which the first 5 megs are mmap'ed into a userspace process. Now suppose you call COLLAPASE_RANGE on a one megabyte range starting at offset 1024k from the beginning of the file. Does the right thing happen to the mmap'ed region

[PATCH 1/3] fs: Introduce new flag FALLOC_FL_COLLAPSE_RANGE

2013-07-31 Thread Namjae Jeon
From: Namjae Jeon Fallocate now supports new FALLOC_FL_COLLAPSE_RANGE flag. The semantics of this flag are following: 1) It collapses the range lying between offset and length by removing any data blocks which are present in this range and than updates all the logical offsets of extents bey