[Ocfs2-devel] [PATCH 2/3] jbd2: Remove barrier feature conditional flag (or: always issue flushes)

2011-01-31 Thread Darrick J. Wong
doesn't support it. Signed-off-by: Darrick J. Wong --- fs/ext4/fsync.c |5 ++--- fs/ext4/super.c |7 --- fs/jbd2/checkpoint.c |3 +-- fs/jbd2/commit.c | 10 +++--- fs/ocfs2/journal.c |4 include/linux/jbd2.h |1 - 6 files changed, 6 inser

[Ocfs2-devel] ocfs2 quota/reflink bug?

2016-01-28 Thread Darrick J. Wong
Hi there, This might sound a little funny coming from me, but I think I found a quota bug in ocfs2. The user quota isn't charged when creating a reflink copy, but chowning the file credits the old owner and charges the new owner, resulting in an integer underflow in block usage accounting. ocfs2

Re: [Ocfs2-devel] [PATCH 1/3] direct-io: always call ->end_io if non-NULL

2016-02-02 Thread Darrick J. Wong
On Tue, Feb 02, 2016 at 09:17:35PM +0100, Christoph Hellwig wrote: > See http://www.infradead.org/rpr.html Ick. ^^^ > This way we can pass back errors to the file system, and allow for > cleanup required for all direct I/O invocations. > > Signed-off-by: Christoph Hellwig > --- > fs/dax.c

Re: [Ocfs2-devel] [PATCH 1/3] direct-io: always call ->end_io if non-NULL

2016-02-03 Thread Darrick J. Wong
On Wed, Feb 03, 2016 at 07:40:14PM +0100, Christoph Hellwig wrote: > This way we can pass back errors to the file system, and allow for > cleanup required for all direct I/O invocations. > > Also allow the ->end_io handlers to return errors on their own, so that > I/O completion errors can be pass

Re: [Ocfs2-devel] vfs/xfs: directio updates to ease COW handling V2

2016-02-03 Thread Darrick J. Wong
On Wed, Feb 03, 2016 at 02:43:02PM -0500, Jeff Moyer wrote: > Hi, Christoph, > > Can you explain a bit what you mean by easing COW handling? Whenever I > see COW referenced near DIO, my mind always turns to g_u_p vs. fork. Just to clarify, I'm talking about copy on write for disk blocks, not for

Re: [Ocfs2-devel] [PATCH 1/3] direct-io: always call ->end_io if non-NULL

2016-02-04 Thread Darrick J. Wong
On Thu, Feb 04, 2016 at 08:14:55AM +0100, Christoph Hellwig wrote: > On Wed, Feb 03, 2016 at 11:55:31AM -0800, Darrick J. Wong wrote: > > This will have the effect of a later error superseding an earlier error. > > I'm > > under the impression that code should generall

Re: [Ocfs2-devel] [PATCH 2/3] xfs: don't use ioends for direct write completions

2016-02-05 Thread Darrick J. Wong
On Wed, Feb 03, 2016 at 07:40:15PM +0100, Christoph Hellwig wrote: > We only need to communicate two bits of information to the direct I/O > completion handler: > > (1) do we need to convert any unwritten extents in the range > (2) do we need to check if we need to update the inode size based >

[Ocfs2-devel] [LFS/MM TOPIC] fs reflink issues, fs online scrub/check, etc

2016-02-10 Thread Darrick J. Wong
[resend, email exploded, sorry...] Hi, I want to discuss a few FS related topics that I haven't already seen on the mailing lists: * Shared pagecache pages for reflinked files (and by extension making dax work with reflink on xfs) * Providing a simple interface for scrubbing filesystem met

Re: [Ocfs2-devel] HEADUP: generic FICLONE ioctl and ->clone_file_range method

2016-03-21 Thread Darrick J. Wong
On Mon, Mar 21, 2016 at 08:28:20PM -0600, Gang He wrote: > Hi Christoph, > > The feature sounds good. OCFS2 has file clone feature (so far, we only > support clone the whole file), what efforts will be involved if we add this > feature support? An oversimplified answer to that question is "wire u

Re: [Ocfs2-devel] The comment should be started with 0x08.

2016-03-24 Thread Darrick J. Wong
On Fri, Mar 25, 2016 at 02:02:36AM +, Guozhonghua wrote: > > struct ocfs2_extended_slot { > /*00*/ __u8es_valid; > __u8es_reserved1[3]; > __le32 es_node_num; > -/*10*/ > +/*08*/ > }; > > > -

Re: [Ocfs2-devel] Announcing btrfs-dedupe

2016-11-08 Thread Darrick J. Wong
On Tue, Nov 08, 2016 at 10:59:56AM -0800, Mark Fasheh wrote: > On Mon, Nov 7, 2016 at 6:17 PM, Darrick J. Wong > wrote: > > On Mon, Nov 07, 2016 at 09:54:09PM +0100, Adam Borowski wrote: > >> Mark has already included XFS in documentation of duperemove, all that > >

[Ocfs2-devel] [PATCH 2/6] ocfs2: add newlines to some error messages

2016-11-09 Thread Darrick J. Wong
These two error messages are missing the trailing newline. Signed-off-by: Darrick J. Wong --- fs/ocfs2/alloc.c |4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/fs/ocfs2/alloc.c b/fs/ocfs2/alloc.c index f72712f..bb2d207 100644 --- a/fs/ocfs2/alloc.c +++ b/fs/ocfs2

[Ocfs2-devel] [PATCH 3/6] ocfs2: prohibit refcounted swapfiles

2016-11-09 Thread Darrick J. Wong
The swapfile mechanism calls bmap once to find all the swap file mappings, which means that we cannot properly support CoW remapping. Therefore, error out if the swap code tries to call bmap on a refcounted file. Signed-off-by: Darrick J. Wong --- fs/ocfs2/aops.c |9 + 1 file

[Ocfs2-devel] [PATCH 1/6] ocfs2: convert inode refcount test to a helper

2016-11-09 Thread Darrick J. Wong
Replace the open-coded inode refcount flag test with a helper function to reduce the potential for bugs. Signed-off-by: Darrick J. Wong --- fs/ocfs2/refcounttree.c | 28 +++- fs/ocfs2/refcounttree.h |2 ++ 2 files changed, 17 insertions(+), 13 deletions(-) diff

[Ocfs2-devel] [PATCH 6/6] ocfs2: implement the VFS clone_range, copy_range, and dedupe_range features

2016-11-09 Thread Darrick J. Wong
, but the VFS ioctls are more broadly supported. Signed-off-by: Darrick J. Wong --- fs/ocfs2/file.c | 62 - fs/ocfs2/file.h |3 fs/ocfs2/refcounttree.c | 619 +++ fs/ocfs2/refcounttree.h |7 + 4 files changed, 688 inser

[Ocfs2-devel] [PATCH 5/6] ocfs2: don't eat io errors during _dio_end_io_write

2016-11-09 Thread Darrick J. Wong
ocfs2_dio_end_io_write eats whatever errors may happen, which means that write errors do not propagate to userspace. Fix that. Signed-off-by: Darrick J. Wong --- fs/ocfs2/aops.c | 15 +-- 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/fs/ocfs2/aops.c b/fs/ocfs2

[Ocfs2-devel] [PATCH 4/6] ocfs2: budget for extent tree splits when adding refcount flag

2016-11-09 Thread Darrick J. Wong
split but not a refcount split because meta_ac never gets allocated. Signed-off-by: Darrick J. Wong --- fs/ocfs2/refcounttree.c |3 +++ 1 file changed, 3 insertions(+) diff --git a/fs/ocfs2/refcounttree.c b/fs/ocfs2/refcounttree.c index 59be8f4..d92b6c6 100644 --- a/fs/ocfs2/refcounttree.

[Ocfs2-devel] [PATCH 7/6] xfstests: fix some minor problems testing ocfs2

2016-11-09 Thread Darrick J. Wong
There are a a few things about ocfs2 tools that need special-casing in xfstests, so fix them so that we can start testing ocfs2. Signed-off-by: Darrick J. Wong --- common/quota |2 +- common/rc| 10 -- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/common/quota

[Ocfs2-devel] [PATCH 0/6] ocfs2: wire up {clone, copy, dedupe}_range

2016-11-09 Thread Darrick J. Wong
Hi all, These patches wire up the existing ocfs2 reflinking capabilities to the new(ish) VFS {copy,clone,dedupe}_range interface. The first few patches clean up some minor bugs that I found; the last kernel patch contains the new code. A few minor fixes to xfstests are needed to make more of the

Re: [Ocfs2-devel] [PATCH 4/6] ocfs2: budget for extent tree splits when adding refcount flag

2016-11-10 Thread Darrick J. Wong
On Thu, Nov 10, 2016 at 05:20:27PM +0800, Darwin wrote: > Hello, > > On Thu, Nov 10, 2016 at 6:51 AM, Darrick J. Wong > wrote: > > When we're adding the refcount flag to an extent, we have to budget > > enough space to handle a full extent btree split in addition to

Re: [Ocfs2-devel] [PATCH 1/6] ocfs2: convert inode refcount test to a helper

2016-11-10 Thread Darrick J. Wong
On Thu, Nov 10, 2016 at 10:14:48AM +0800, Eric Ren wrote: > On 11/10/2016 06:51 AM, Darrick J. Wong wrote: > >Replace the open-coded inode refcount flag test with a helper function > >to reduce the potential for bugs. > Thanks for this series;-) Some comments inline below: &g

[Ocfs2-devel] [PATCH v2 1/6] ocfs2: convert inode refcount test to a helper

2016-11-10 Thread Darrick J. Wong
Replace the open-coded inode refcount flag test with a helper function to reduce the potential for bugs. Signed-off-by: Darrick J. Wong --- fs/ocfs2/alloc.c|3 +-- fs/ocfs2/file.c |7 +++ fs/ocfs2/inode.h|6 ++ fs/ocfs2/move_extents.c | 10

Re: [Ocfs2-devel] [PATCH 6/6] ocfs2: implement the VFS clone_range, copy_range, and dedupe_range features

2016-11-10 Thread Darrick J. Wong
On Fri, Nov 11, 2016 at 01:49:48PM +0800, Eric Ren wrote: > Hi, > > A few issues obvious to me: > > On 11/10/2016 06:51 AM, Darrick J. Wong wrote: > >Connect the new VFS clone_range, copy_range, and dedupe_range features > >to the existing reflink capability of ocfs2

Re: [Ocfs2-devel] [PATCH 6/6] ocfs2: implement the VFS clone_range, copy_range, and dedupe_range features

2016-11-11 Thread Darrick J. Wong
On Fri, Nov 11, 2016 at 02:45:54PM +0800, Eric Ren wrote: > On 11/11/2016 02:20 PM, Darrick J. Wong wrote: > >On Fri, Nov 11, 2016 at 01:49:48PM +0800, Eric Ren wrote: > >>Hi, > >> > >>A few issues obvious to me: > >> > >>On 11/10/2016 06:

[Ocfs2-devel] [PATCH v2 6/6] ocfs2: implement the VFS clone_range, copy_range, and dedupe_range features

2016-11-11 Thread Darrick J. Wong
, but the VFS ioctls are more broadly supported. Signed-off-by: Darrick J. Wong --- v2: Convert inline data files to extents files before reflinking, and fix i_blocks so that stat(2) output is correct. fsync the inoe correctly. --- fs/ocfs2/file.c | 62 - fs/ocfs2/file.h |

Re: [Ocfs2-devel] [PATCH 0/6] ocfs2: wire up {clone, copy, dedupe}_range

2016-11-11 Thread Darrick J. Wong
On Fri, Nov 11, 2016 at 11:15:57AM +0800, Eric Ren wrote: > Hi, > > On 11/10/2016 06:51 AM, Darrick J. Wong wrote: > >Hi all, > > > >These patches wire up the existing ocfs2 reflinking capabilities to > >the new(ish) VFS {copy,clone,dedupe}_range interface. The f

[Ocfs2-devel] [PATCH 6/7] ocfs2: implement the VFS clone_range, copy_range, and dedupe_range features

2016-11-22 Thread Darrick J. Wong
, but the VFS ioctls are more broadly supported. Signed-off-by: Darrick J. Wong --- v2: Convert inline data files to extents files before reflinking, and fix i_blocks so that stat(2) output is correct. v3: Make zero-length dedupe consistent with btrfs behavior. --- fs/ocfs2/file.c |

[Ocfs2-devel] [PATCH 3/7] ocfs2: prohibit refcounted swapfiles

2016-11-22 Thread Darrick J. Wong
The swapfile mechanism calls bmap once to find all the swap file mappings, which means that we cannot properly support CoW remapping. Therefore, error out if the swap code tries to call bmap on a refcounted file. Signed-off-by: Darrick J. Wong --- fs/ocfs2/aops.c |9 + 1 file

[Ocfs2-devel] [PATCH 7/7] ocfs2: charge quota for reflinked blocks

2016-11-22 Thread Darrick J. Wong
them causes quota usage to *decrease* by X as seen in generic/305. Signed-off-by: Darrick J. Wong --- fs/ocfs2/refcounttree.c |7 +++ 1 file changed, 7 insertions(+) diff --git a/fs/ocfs2/refcounttree.c b/fs/ocfs2/refcounttree.c index c3c809a..a1290e3 100644 --- a/fs/ocfs2/refcounttree.c +++

[Ocfs2-devel] [PATCH 5/7] ocfs2: don't eat io errors during _dio_end_io_write

2016-11-22 Thread Darrick J. Wong
ocfs2_dio_end_io_write eats whatever errors may happen, which means that write errors do not propagate to userspace. Fix that. Signed-off-by: Darrick J. Wong --- fs/ocfs2/aops.c | 15 +-- 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/fs/ocfs2/aops.c b/fs/ocfs2

[Ocfs2-devel] [PATCH 1/7] ocfs2: convert inode refcount test to a helper

2016-11-22 Thread Darrick J. Wong
Replace the open-coded inode refcount flag test with a helper function to reduce the potential for bugs. Signed-off-by: Darrick J. Wong --- fs/ocfs2/alloc.c|3 +-- fs/ocfs2/file.c |7 +++ fs/ocfs2/inode.h|6 ++ fs/ocfs2/move_extents.c | 10

[Ocfs2-devel] [PATCH 2/7] ocfs2: add newlines to some error messages

2016-11-22 Thread Darrick J. Wong
These two error messages are missing the trailing newline. Signed-off-by: Darrick J. Wong --- fs/ocfs2/alloc.c |4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/fs/ocfs2/alloc.c b/fs/ocfs2/alloc.c index a0ca49f..d4ec0d8 100644 --- a/fs/ocfs2/alloc.c +++ b/fs/ocfs2

[Ocfs2-devel] [PATCH 4/7] ocfs2: budget for extent tree splits when adding refcount flag

2016-11-22 Thread Darrick J. Wong
split but not a refcount split because meta_ac never gets allocated. Signed-off-by: Darrick J. Wong --- fs/ocfs2/refcounttree.c |3 +++ 1 file changed, 3 insertions(+) diff --git a/fs/ocfs2/refcounttree.c b/fs/ocfs2/refcounttree.c index 3410eb1..6c98d56 100644 --- a/fs/ocfs2/refcounttree.

[Ocfs2-devel] [PATCH v2 0/7] ocfs2: wire up {clone, copy, dedupe}_range

2016-11-22 Thread Darrick J. Wong
Hi all, This is the second submission of a series of patches that wire up the existing ocfs2 reflinking capabilities to the new(ish) VFS {copy,clone,dedupe}_range interface. The first few patches clean up some minor bugs that I found; the last kernel patch contains the new code. The last patch i

Re: [Ocfs2-devel] [PATCH 6/7] ocfs2: implement the VFS clone_range, copy_range, and dedupe_range features

2016-11-28 Thread Darrick J. Wong
On Fri, Nov 25, 2016 at 12:18:22AM -0800, Christoph Hellwig wrote: > > +static ssize_t ocfs2_file_copy_range(struct file *file_in, > > +loff_t pos_in, > > +struct file *file_out, > > +loff_t pos_out, > >

[Ocfs2-devel] [PATCH 8/8] ocfs2: charge quota for reflinked blocks

2016-12-01 Thread Darrick J. Wong
them causes quota usage to *decrease* by X as seen in generic/305. Signed-off-by: Darrick J. Wong --- fs/ocfs2/refcounttree.c |7 +++ 1 file changed, 7 insertions(+) diff --git a/fs/ocfs2/refcounttree.c b/fs/ocfs2/refcounttree.c index 57297ce..33555d58 100644 --- a/fs/ocfs2/refcounttree.c

[Ocfs2-devel] [PATCH 5/8] ocfs2: don't eat io errors during _dio_end_io_write

2016-12-01 Thread Darrick J. Wong
ocfs2_dio_end_io_write eats whatever errors may happen, which means that write errors do not propagate to userspace. Fix that. Signed-off-by: Darrick J. Wong --- fs/ocfs2/aops.c | 15 +-- 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/fs/ocfs2/aops.c b/fs/ocfs2

[Ocfs2-devel] [PATCH 2/8] ocfs2: add newlines to some error messages

2016-12-01 Thread Darrick J. Wong
These two error messages are missing the trailing newline. Signed-off-by: Darrick J. Wong --- fs/ocfs2/alloc.c |4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/fs/ocfs2/alloc.c b/fs/ocfs2/alloc.c index a0ca49f..d4ec0d8 100644 --- a/fs/ocfs2/alloc.c +++ b/fs/ocfs2

[Ocfs2-devel] [PATCH 1/8] ocfs2: convert inode refcount test to a helper

2016-12-01 Thread Darrick J. Wong
Replace the open-coded inode refcount flag test with a helper function to reduce the potential for bugs. Signed-off-by: Darrick J. Wong --- fs/ocfs2/alloc.c|3 +-- fs/ocfs2/file.c |7 +++ fs/ocfs2/inode.h|6 ++ fs/ocfs2/move_extents.c | 10

[Ocfs2-devel] [PATCH 4/8] ocfs2: budget for extent tree splits when adding refcount flag

2016-12-01 Thread Darrick J. Wong
split but not a refcount split because meta_ac never gets allocated. Signed-off-by: Darrick J. Wong --- fs/ocfs2/refcounttree.c |3 +++ 1 file changed, 3 insertions(+) diff --git a/fs/ocfs2/refcounttree.c b/fs/ocfs2/refcounttree.c index 3410eb1..6c98d56 100644 --- a/fs/ocfs2/refcounttree.

[Ocfs2-devel] [PATCH 3/8] ocfs2: prohibit refcounted swapfiles

2016-12-01 Thread Darrick J. Wong
The swapfile mechanism calls bmap once to find all the swap file mappings, which means that we cannot properly support CoW remapping. Therefore, error out if the swap code tries to call bmap on a refcounted file. Signed-off-by: Darrick J. Wong --- fs/ocfs2/aops.c |9 + 1 file

[Ocfs2-devel] [PATCH 6/8] ocfs2: always unlock when completing dio writes

2016-12-01 Thread Darrick J. Wong
Always unlock the inode when completing dio writes, even if an error has occurrred. The caller already checks the inode and unlocks it if needed, so we might as well reduce contention. Signed-off-by: Darrick J. Wong --- fs/ocfs2/aops.c |5 + 1 file changed, 1 insertion(+), 4 deletions

[Ocfs2-devel] [PATCH 7/8] ocfs2: implement the VFS clone_range, copy_range, and dedupe_range features

2016-12-01 Thread Darrick J. Wong
, but the VFS ioctls are more broadly supported. Signed-off-by: Darrick J. Wong --- v2: Convert inline data files to extents files before reflinking, and fix i_blocks so that stat(2) output is correct. v3: Make zero-length dedupe consistent with btrfs behavior. v4: Use VFS double-inode lock rou

[Ocfs2-devel] [PATCH v3 0/8] ocfs2: wire up {clone, copy, dedupe}_range

2016-12-01 Thread Darrick J. Wong
Hi all, This is the third submission of a series of patches that wire up the existing ocfs2 reflinking capabilities to the new(ish) VFS {copy,clone,dedupe}_range interface. The first few patches clean up some minor bugs that I found; the last kernel patch contains the new code. The last patch is

Re: [Ocfs2-devel] [PATCH v3 0/8] ocfs2: wire up {clone, copy, dedupe}_range

2016-12-08 Thread Darrick J. Wong
On Thu, Dec 01, 2016 at 04:54:22PM -0800, Darrick J. Wong wrote: > Hi all, > > This is the third submission of a series of patches that wire up the > existing ocfs2 reflinking capabilities to the new(ish) VFS > {copy,clone,dedupe}_range interface. The first few patches clean up &g

[Ocfs2-devel] [PATCH 06/11] ocfs2: budget for extent tree splits when adding refcount flag

2016-12-10 Thread Darrick J. Wong
split but not a refcount split because meta_ac never gets allocated. Signed-off-by: Darrick J. Wong --- fs/ocfs2/refcounttree.c |3 +++ 1 file changed, 3 insertions(+) diff --git a/fs/ocfs2/refcounttree.c b/fs/ocfs2/refcounttree.c index 3410eb1..6c98d56 100644 --- a/fs/ocfs2/refcounttree.

[Ocfs2-devel] [PATCH 09/11] ocfs2: fix bad pointer cast

2016-12-10 Thread Darrick J. Wong
generic/188 triggered a dmesg stack trace because the dio completion was casting a buffer head to an on-disk inode, which is whacky. Signed-off-by: Darrick J. Wong --- fs/ocfs2/aops.c |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fs/ocfs2/aops.c b/fs/ocfs2/aops.c index

[Ocfs2-devel] [PATCH v4 00/11] ocfs2: wire up {clone, copy, dedupe}_range

2016-12-10 Thread Darrick J. Wong
Hi all, This is the fourth submission of a series of patches that wire up the existing ocfs2 reflinking capabilities to the new(ish) VFS {copy,clone,dedupe}_range interface. The first few patches hoist some of the reflink/dedupe prep functions into the VFS since the code is common to XFS and ocfs

[Ocfs2-devel] [PATCH 08/11] ocfs2: always unlock when completing dio writes

2016-12-10 Thread Darrick J. Wong
Always unlock the inode when completing dio writes, even if an error has occurrred. The caller already checks the inode and unlocks it if needed, so we might as well reduce contention. Signed-off-by: Darrick J. Wong --- fs/ocfs2/aops.c |5 + 1 file changed, 1 insertion(+), 4 deletions

[Ocfs2-devel] [PATCH 07/11] ocfs2: don't eat io errors during _dio_end_io_write

2016-12-10 Thread Darrick J. Wong
ocfs2_dio_end_io_write eats whatever errors may happen, which means that write errors do not propagate to userspace. Fix that. Signed-off-by: Darrick J. Wong --- fs/ocfs2/aops.c | 15 +-- 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/fs/ocfs2/aops.c b/fs/ocfs2

[Ocfs2-devel] [PATCH 05/11] ocfs2: prohibit refcounted swapfiles

2016-12-10 Thread Darrick J. Wong
The swapfile mechanism calls bmap once to find all the swap file mappings, which means that we cannot properly support CoW remapping. Therefore, error out if the swap code tries to call bmap on a refcounted file. Signed-off-by: Darrick J. Wong --- fs/ocfs2/aops.c |9 + 1 file

[Ocfs2-devel] [PATCH 04/11] ocfs2: add newlines to some error messages

2016-12-10 Thread Darrick J. Wong
These two error messages are missing the trailing newline. Signed-off-by: Darrick J. Wong --- fs/ocfs2/alloc.c |4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/fs/ocfs2/alloc.c b/fs/ocfs2/alloc.c index a0ca49f..d4ec0d8 100644 --- a/fs/ocfs2/alloc.c +++ b/fs/ocfs2

[Ocfs2-devel] [PATCH 03/11] ocfs2: convert inode refcount test to a helper

2016-12-10 Thread Darrick J. Wong
Replace the open-coded inode refcount flag test with a helper function to reduce the potential for bugs. Signed-off-by: Darrick J. Wong --- fs/ocfs2/alloc.c|3 +-- fs/ocfs2/file.c |7 +++ fs/ocfs2/inode.h|6 ++ fs/ocfs2/move_extents.c | 10

[Ocfs2-devel] [PATCH 02/11] vfs: refactor clone/dedupe_file_range common functions

2016-12-10 Thread Darrick J. Wong
Hoist both the XFS reflink inode state and preparation code and the XFS file blocks compare functions into the VFS so that ocfs2 can take advantage of it for reflink and dedupe. Signed-off-by: Darrick J. Wong --- fs/read_write.c | 204 fs

[Ocfs2-devel] [PATCH 10/11] ocfs2: charge quota for reflinked blocks

2016-12-10 Thread Darrick J. Wong
them causes quota usage to *decrease* by X as seen in generic/305. Signed-off-by: Darrick J. Wong --- fs/ocfs2/refcounttree.c |7 +++ 1 file changed, 7 insertions(+) diff --git a/fs/ocfs2/refcounttree.c b/fs/ocfs2/refcounttree.c index 6c98d56..dc8089a 100644 --- a/fs/ocfs2/refcounttree.c +++

[Ocfs2-devel] [PATCH 11/11] ocfs2: implement the VFS clone_range, copy_range, and dedupe_range features

2016-12-10 Thread Darrick J. Wong
, but the VFS ioctls are more broadly supported. Signed-off-by: Darrick J. Wong --- v2: Convert inline data files to extents files before reflinking, and fix i_blocks so that stat(2) output is correct. v3: Make zero-length dedupe consistent with btrfs behavior. v4: Use VFS double-inode lock rou

[Ocfs2-devel] [PATCH 4/7] reflink: fix space consumption tests

2016-12-11 Thread Darrick J. Wong
Some of the tests try to check that we can't COW when we're out of space, but some tricky filesystems make this hard because writing N blocks doesn't increase used blocks by N Signed-off-by: Darrick J. Wong --- common/populate | 14 ++ tests/generic/171 |

[Ocfs2-devel] [PATCH 1/7] ocfs2: test reflinking to inline data files

2016-12-11 Thread Darrick J. Wong
Make sure that we can handle reflinking from and to inline-data files. Signed-off-by: Darrick J. Wong --- common/reflink |2 + tests/ocfs2/001 | 88 ++ tests/ocfs2/001.out | 14 tests/ocfs2/Makefile | 20

[Ocfs2-devel] [PATCH 0/7] xfstests: misc reflink test fixes

2016-12-11 Thread Darrick J. Wong
Hi all, The following patchset enable the use of xfstests to test reflink functionality under ocfs2. The first patch tests the ability to reflink into and out of inline-data files on ocfs2. Patches 2-6 fix various problems with the tests that came up when qualifying ocfs2. The last patch malici

[Ocfs2-devel] [PATCH 7/7] xfs/ext4: check negative inode size

2016-12-11 Thread Darrick J. Wong
Craft a malicious filesystem image with a negative inode size, then try to trigger a kernel DoS by appending data to the file. Ideally this should trigger verifier errors instead of hanging. Signed-off-by: Darrick J. Wong --- tests/ext4/400 | 71

[Ocfs2-devel] [PATCH 3/7] reflink: fix quota tests to work properly

2016-12-11 Thread Darrick J. Wong
-off-by: Darrick J. Wong --- tests/generic/305 |2 +- tests/generic/305.out | 30 +++--- tests/generic/326 |2 +- tests/generic/326.out | 30 +++--- tests/generic/327 | 12 +++- tests/generic/327.out | 12

[Ocfs2-devel] [PATCH 2/7] ocfs2/reflink: fix file block size reporting

2016-12-11 Thread Darrick J. Wong
which causes these reflink tests to fail. Therefore, introduce a new helper that retrieves the file minimum block size and adapt the reflink tests to use that instead. Signed-off-by: Darrick J. Wong --- common/rc | 21 +++-- tests/generic/205 |2 +- tests/generi

[Ocfs2-devel] [PATCH 6/7] reflink: don't test disjoint block sharing sets

2016-12-11 Thread Darrick J. Wong
also means that blocks cannot be reflinked between two disjoint refcounted-file-sets. generic/119 tests the ability to do this, so we cannot run it for ocfs2. Create a _require helper to check for this. Signed-off-by: Darrick J. Wong --- common/reflink|9 + tests/generic/119

Re: [Ocfs2-devel] [PATCH v4 00/11] ocfs2: wire up {clone, copy, dedupe}_range

2016-12-11 Thread Darrick J. Wong
On Sat, Dec 10, 2016 at 11:46:27PM +, Al Viro wrote: > On Sat, Dec 10, 2016 at 11:43:25PM +, Al Viro wrote: > > On Sat, Dec 10, 2016 at 12:42:55PM -0800, Darrick J. Wong wrote: > > > Hi all, > > > > > > This is the fourth submission of a series of pat

[Ocfs2-devel] [PATCH 5/7] reflink: make error reporting consistent

2016-12-11 Thread Darrick J. Wong
When we're using dm-error to simulate failed devices, we don't really know if the write or the fdatasync is going to receive the EIO. So, capture the entire output and just look for the word error instead of enshrining it in the golden output. Signed-off-by: Darrick J. Wong --- tes

Re: [Ocfs2-devel] [PATCH 1/7] ocfs2: test reflinking to inline data files

2016-12-12 Thread Darrick J. Wong
On Mon, Dec 12, 2016 at 05:01:20PM +0800, Eryu Guan wrote: > On Sun, Dec 11, 2016 at 01:52:51PM -0800, Darrick J. Wong wrote: > > Make sure that we can handle reflinking from and to inline-data files. > > > > Signed-off-by: Darrick J. Wong > > --- > > common/

Re: [Ocfs2-devel] [PATCH 4/7] reflink: fix space consumption tests

2016-12-12 Thread Darrick J. Wong
On Mon, Dec 12, 2016 at 06:25:39PM +0800, Eryu Guan wrote: > On Sun, Dec 11, 2016 at 01:53:10PM -0800, Darrick J. Wong wrote: > > Some of the tests try to check that we can't COW when we're out of > > space, but some tricky filesystems make this hard because writing N &g

Re: [Ocfs2-devel] [PATCH 5/7] reflink: make error reporting consistent

2016-12-12 Thread Darrick J. Wong
On Mon, Dec 12, 2016 at 06:47:43PM +0800, Eryu Guan wrote: > On Sun, Dec 11, 2016 at 01:53:16PM -0800, Darrick J. Wong wrote: > > When we're using dm-error to simulate failed devices, we don't really > > know if the write or the fdatasync is going to receive the EIO. S

Re: [Ocfs2-devel] [PATCH 3/7] reflink: fix quota tests to work properly

2016-12-12 Thread Darrick J. Wong
On Mon, Dec 12, 2016 at 06:06:22PM +0800, Eryu Guan wrote: > On Sun, Dec 11, 2016 at 01:53:04PM -0800, Darrick J. Wong wrote: > > Fix the reflink quota tests to su to the fsgqa user so that we actually > > test enforcement of quotas. Seems that XFS enforces user quotas even > &g

Re: [Ocfs2-devel] [PATCH 2/7] ocfs2/reflink: fix file block size reporting

2016-12-12 Thread Darrick J. Wong
On Mon, Dec 12, 2016 at 05:48:20PM +0800, Eryu Guan wrote: > On Sun, Dec 11, 2016 at 01:52:57PM -0800, Darrick J. Wong wrote: > > Some of the reflink tests try to require a specific filesystem block > > size so that they can test file block manipulation functions. That's >

Re: [Ocfs2-devel] [PATCH 1/7] ocfs2: test reflinking to inline data files

2016-12-12 Thread Darrick J. Wong
On Tue, Dec 13, 2016 at 11:20:57AM +0800, Eryu Guan wrote: > On Mon, Dec 12, 2016 at 10:09:22AM -0800, Darrick J. Wong wrote: > > On Mon, Dec 12, 2016 at 05:01:20PM +0800, Eryu Guan wrote: > > > On Sun, Dec 11, 2016 at 01:52:51PM -0800, Darrick J. Wong wrote: > > > >

Re: [Ocfs2-devel] [PATCH 1/7] ocfs2: test reflinking to inline data files

2016-12-13 Thread Darrick J. Wong
On Mon, Dec 12, 2016 at 11:11:36PM -0800, Darrick J. Wong wrote: > On Tue, Dec 13, 2016 at 11:20:57AM +0800, Eryu Guan wrote: > > On Mon, Dec 12, 2016 at 10:09:22AM -0800, Darrick J. Wong wrote: > > > On Mon, Dec 12, 2016 at 05:01:20PM +0800, Eryu Guan wrote: > > > >

Re: [Ocfs2-devel] [PATCH 7/7] xfs/ext4: check negative inode size

2016-12-13 Thread Darrick J. Wong
On Mon, Dec 12, 2016 at 07:07:21PM +0800, Eryu Guan wrote: > On Sun, Dec 11, 2016 at 01:53:28PM -0800, Darrick J. Wong wrote: > > Craft a malicious filesystem image with a negative inode size, > > then try to trigger a kernel DoS by appending data to the file. > > Ideall

Re: [Ocfs2-devel] [DRAFT] ocfs2: commit the transtion before goto out to avoid blocked.

2017-04-01 Thread Darrick J. Wong
On Sat, Apr 01, 2017 at 11:42:36AM +, Guozhonghua wrote: > Hi, > > For the commit: 2b0ad0085aa47ace4756aa501274a7de0325c09c > > Mar 31 14:42:59 wy-ost209 kernel: [795291.811547] OCFS2: ERROR (device > dm-11): ocfs2_block_group_clear_bits: Group descriptor # 33030144 has bit > count 32256

Re: [Ocfs2-devel] [PATCH 09/28] ext4: extended attribute value size limit is enforced by vfs

2017-05-31 Thread Darrick J. Wong
On Wed, May 31, 2017 at 01:14:58AM -0700, Tahsin Erdogan wrote: > EXT4_XATTR_MAX_LARGE_EA_SIZE definition in ext4 is currently unused. > Besides, vfs enforces its own 64k limit which makes the 1MB limit in > ext4 redundant. Remove it. > > Signed-off-by: Tahsin Erdogan > --- > fs/ext4/ext4.h | 6

Re: [Ocfs2-devel] [PATCH 27/28] ext4: xattr inode deduplication

2017-05-31 Thread Darrick J. Wong
On Wed, May 31, 2017 at 01:15:16AM -0700, Tahsin Erdogan wrote: > Ext4 now supports xattr values that are up to 64k in size (vfs limit). > Large xattr values are stored in external inodes each one holding a > single value. Once written the data blocks of these inodes are immutable. > > The real wo

Re: [Ocfs2-devel] [PATCH 01/28] ext4: xattr-in-inode support

2017-05-31 Thread Darrick J. Wong
On Wed, May 31, 2017 at 01:14:50AM -0700, Tahsin Erdogan wrote: > From: Andreas Dilger > > Large xattr support is implemented for EXT4_FEATURE_INCOMPAT_EA_INODE. > > If the size of an xattr value is larger than will fit in a single > external block, then the xattr value will be saved into the bo

Re: [Ocfs2-devel] [PATCH 07/28] ext4: call journal revoke when freeing ea_inode blocks

2017-05-31 Thread Darrick J. Wong
On Wed, May 31, 2017 at 01:14:56AM -0700, Tahsin Erdogan wrote: > ea_inode contents are treated as metadata, that's why it is journaled > during initial writes. Failing to call revoke during freeing could cause > user data to be overwritten with original ea_inode contents during journal > replay. >

Re: [Ocfs2-devel] [PATCH v2 27/28] ext4: xattr inode deduplication

2017-06-01 Thread Darrick J. Wong
On Wed, May 31, 2017 at 03:33:57PM -0700, Tahsin Erdogan wrote: > Ext4 now supports xattr values that are up to 64k in size (vfs limit). > Large xattr values are stored in external inodes each one holding a > single value. Once written the data blocks of these inodes are immutable. > > The real wo

Re: [Ocfs2-devel] [PATCH v2 27/28] ext4: xattr inode deduplication

2017-06-02 Thread Darrick J. Wong
On Fri, Jun 02, 2017 at 05:46:22AM -0700, Tahsin Erdogan wrote: > > Hmm... normally we'd supply sbi->s_csum_seed as the second argument so > > that the metadata checksum value also has the fs uuid stamped into it. > > I have thought about using sbi->s_csum_seed and was a little hesitant > because

Re: [Ocfs2-devel] [PATCH 29/31] ext4: reserve space for xattr entries/names

2017-06-14 Thread Darrick J. Wong
On Wed, Jun 14, 2017 at 10:23:26AM -0700, Tahsin Erdogan wrote: > New ea_inode feature allows putting large xattr values into external > inodes. struct ext4_xattr_entry and the attribute name however have to > remain in the inode extra space or external attribute block. Once that > space is exhaust

Re: [Ocfs2-devel] [trivial PATCH] treewide: Align function definition open/close braces

2017-12-18 Thread Darrick J. Wong
struct xfs_buf *bp) > - { > +{ > struct xfs_agf *agf = XFS_BUF_TO_AGF(bp); > > if (xfs_sb_version_hascrc(&mp->m_sb)) { > @@ -2449,8 +2449,7 @@ xfs_agf_verify( >be32_to_cpu(agf->agf_refcount_level) > XFS_BTREE_MAXLEVELS)) >

[Ocfs2-devel] [PATCH 5/6] ocfs2: Wait for page writeback to provide stable pages

2013-01-20 Thread Darrick J. Wong
When stable pages are required, we have to wait if the page is just going to disk and we want to modify it. Add proper callback to ocfs2_grab_pages_for_write(). CC: ocfs2-devel@oss.oracle.com CC: Joel Becker CC: Mark Fasheh From: Jan Kara Signed-off-by: Jan Kara Signed-off-by: Darrick J. Wong

[Ocfs2-devel] [PATCH 5/6] ocfs2: Wait for page writeback to provide stable pages

2013-01-20 Thread Darrick J. Wong
When stable pages are required, we have to wait if the page is just going to disk and we want to modify it. Add proper callback to ocfs2_grab_pages_for_write(). CC: ocfs2-devel@oss.oracle.com CC: Joel Becker CC: Mark Fasheh From: Jan Kara Signed-off-by: Jan Kara --- fs/ocfs2/aops.c |1 +

[Ocfs2-devel] [PATCH] ocfs2: improve fsync efficiency and fix deadlock between aio_write and sync_file

2014-02-12 Thread Darrick J. Wong
eadlock between ocfs2_file_aio_write() and ocfs2_sync_file(). aio_write takes i_mutex then calls ocfs2_aiodio_wait() to wait for unaligned dio writes to finish. However, if that dio completion involves calling fsync, then we can get into trouble when some ocfs2_sync_file tries to take i_mutex. Signed-off-by:

Re: [Ocfs2-devel] [PATCH] ocfs2: improve fsync efficiency and fix deadlock between aio_write and sync_file

2014-02-12 Thread Darrick J. Wong
On Wed, Feb 12, 2014 at 02:58:18PM -0800, Mark Fasheh wrote: > On Wed, Jan 29, 2014 at 07:48:48PM -0800, Darrick J. Wong wrote: > > Currently, ocfs2_sync_file grabs i_mutex and forces the current > > journal transaction to complete. This isn't terribly efficient, since >

Re: [Ocfs2-devel] [PATCH] ocfs2: improve fsync efficiency and fix deadlock between aio_write and sync_file

2014-02-13 Thread Darrick J. Wong
On Thu, Feb 13, 2014 at 01:33:45PM -0800, Mark Fasheh wrote: > On Wed, Feb 12, 2014 at 05:53:43PM -0800, Darrick J. Wong wrote: > > On Wed, Feb 12, 2014 at 02:58:18PM -0800, Mark Fasheh wrote: > > > On Wed, Jan 29, 2014 at 07:48:48PM -0800, Darrick J. Wong wrote: > > > &

[Ocfs2-devel] [PATCH v2] ocfs2: improve fsync efficiency and fix deadlock between aio_write and sync_file

2014-02-13 Thread Darrick J. Wong
updating mtime. Signed-off-by: Darrick J. Wong --- fs/ocfs2/alloc.c |1 + fs/ocfs2/aops.c|1 + fs/ocfs2/dir.c |4 fs/ocfs2/file.c| 36 +++- fs/ocfs2/inode.c | 28 fs/ocfs2/inode.h |7 ++

[Ocfs2-devel] [PATCH] ocfs2: call ocfs2_update_inode_fsync_trans when updating any inode

2014-03-05 Thread Darrick J. Wong
Ensure that ocfs2_update_inode_fsync_trans() is called any time we touch an inode in a given transaction. This is a follow-on to the previous patch to reduce lock contention and deadlocking during an fsync operation. Signed-off-by: Darrick J. Wong --- fs/ocfs2/acl.c |1 + fs/ocfs2

Re: [Ocfs2-devel] [patch 4/8] ocfs2: call ocfs2_update_inode_fsync_trans when updating any inode

2014-04-09 Thread Darrick J. Wong
On Sun, Mar 30, 2014 at 07:05:46PM -0700, Mark Fasheh wrote: > On Wed, Mar 19, 2014 at 02:10:02PM -0700, Andrew Morton wrote: > > From: "Darrick J. Wong" > > Subject: ocfs2: call ocfs2_update_inode_fsync_trans when updating any inode > > > > Ensure that ocfs2

Re: [Ocfs2-devel] ocfs2 version issue

2015-09-02 Thread Darrick J. Wong
On Wed, Sep 02, 2015 at 07:34:17AM -0500, Goldwyn Rodrigues wrote: > > > On 09/01/2015 07:08 PM, Srinivas Eeda wrote: > > >>> > >>> Ocfs2 kernel version is removed from commit > >>> ff8fb335221e2c446b0d4cbea26be371fd2feb64 ("ocfs2: remove versioning > >>> information"), but Oracle CRS depends on