Re: [PATCH v3] geneirc/077 fix min size for btrfs

2018-10-10 Thread Darrick J. Wong
On Thu, Oct 11, 2018 at 11:26:00AM +0800, Anand Jain wrote: > If btrfs need to be tested at its default blockgroup which is non-mixed, > then it needs at least 256mb. > > Signed-off-by: Anand Jain > --- > v2->v3: > separated from the patch set of 9. > notrun for the cases where

[PATCH 24/25] xfs: support returning partial reflink results

2018-10-10 Thread Darrick J. Wong
From: Darrick J. Wong Back when the XFS reflink code only supported clone_file_range, we were only able to return zero or negative error codes to userspace. However, now that copy_file_range (which returns bytes copied) can use XFS' clone_file_range, we have the opportunity to return partial

[PATCH 25/25] xfs: remove redundant remap partial EOF block checks

2018-10-10 Thread Darrick J. Wong
From: Darrick J. Wong Now that we've moved the partial EOF block checks to the VFS helpers, we can remove the redundantn functionality from XFS. Signed-off-by: Darrick J. Wong --- fs/xfs/xfs_reflink.c | 20 1 file changed, 20 deletions(-) diff --git a/fs/xfs

[PATCH 22/25] ocfs2: support partial clone range and dedupe range

2018-10-10 Thread Darrick J. Wong
From: Darrick J. Wong Change the ocfs2 remap code to allow for returning partial results. Signed-off-by: Darrick J. Wong --- fs/ocfs2/file.c |7 + fs/ocfs2/refcounttree.c | 73 ++- fs/ocfs2/refcounttree.h | 12 3 files

[PATCH 23/25] xfs: fix pagecache truncation prior to reflink

2018-10-10 Thread Darrick J. Wong
From: Darrick J. Wong Prior to remapping blocks, it is necessary to remove pages from the destination file's page cache. Unfortunately, the truncation is not aggressive enough -- if page size > block size, we'll end up zeroing subpage blocks instead of removing them. So, round the start off

[PATCH 20/25] ocfs2: truncate page cache for clone destination file before remapping

2018-10-10 Thread Darrick J. Wong
From: Darrick J. Wong When cloning blocks into another file, truncate the page cache before we start remapping blocks so that concurrent reads wait for us to finish. Signed-off-by: Darrick J. Wong --- fs/ocfs2/refcounttree.c | 10 -- 1 file changed, 4 insertions(+), 6 deletions

[PATCH 21/25] ocfs2: fix pagecache truncation prior to reflink

2018-10-10 Thread Darrick J. Wong
From: Darrick J. Wong Prior to remapping blocks, it is necessary to remove pages from the destination file's page cache. Unfortunately, the truncation is not aggressive enough -- if page size > block size, we'll end up zeroing subpage blocks instead of removing them. So, round the start off

[PATCH 19/25] vfs: implement opportunistic short dedupe

2018-10-10 Thread Darrick J. Wong
From: Darrick J. Wong For a given dedupe request, the bytes_deduped field in the control structure tells userspace if we managed to deduplicate some, but not all of, the requested regions starting from the file offsets supplied. However, due to sloppy coding, the current dedupe code returns

[PATCH 18/25] vfs: hide file range comparison function

2018-10-10 Thread Darrick J. Wong
From: Darrick J. Wong There are no callers of vfs_dedupe_file_range_compare, so we might as well make it a static helper and remove the export. Signed-off-by: Darrick J. Wong Reviewed-by: Amir Goldstein --- fs/read_write.c| 191

[PATCH 16/25] vfs: make remapping to source file eof more explicit

2018-10-10 Thread Darrick J. Wong
From: Darrick J. Wong Create a RFR_TO_SRC_EOF flag to explicitly declare that the caller wants the remap implementation to remap to the end of the source file, once the files are locked. Signed-off-by: Darrick J. Wong Reviewed-by: Amir Goldstein --- fs/ioctl.c |3 ++- fs/nfsd

[PATCH 17/25] vfs: enable remap callers that can handle short operations

2018-10-10 Thread Darrick J. Wong
From: Darrick J. Wong Plumb in a remap flag that enables the filesystem remap handler to shorten remapping requests for callers that can handle it. Now copy_file_range can report partial success (in case we run up against alignment problems, resource limits, etc.). Signed-off-by: Darrick J

[PATCH 15/25] vfs: plumb RFR_* remap flags through the vfs dedupe functions

2018-10-10 Thread Darrick J. Wong
From: Darrick J. Wong Plumb a remap_flags argument through the vfs_dedupe_file_range_one functions so that dedupe can take advantage of it. Signed-off-by: Darrick J. Wong Reviewed-by: Amir Goldstein --- fs/overlayfs/file.c |3 ++- fs/read_write.c |9 ++--- include/linux/fs.h

[PATCH 12/25] vfs: pass remap flags to generic_remap_checks

2018-10-10 Thread Darrick J. Wong
From: Darrick J. Wong Pass the same remap flags to generic_remap_checks for consistency. Signed-off-by: Darrick J. Wong Reviewed-by: Amir Goldstein --- fs/read_write.c|2 +- include/linux/fs.h |2 +- mm/filemap.c |4 ++-- 3 files changed, 4 insertions(+), 4 deletions

[PATCH 13/25] vfs: make remap_file_range functions take and return bytes completed

2018-10-10 Thread Darrick J. Wong
From: Darrick J. Wong Change the remap_file_range functions to take a number of bytes to operate upon and return the number of bytes they operated on. This is a requirement for allowing fs implementations to return short clone/dedupe results to the user, which will enable us to obey resource

[PATCH 14/25] vfs: plumb RFR_* remap flags through the vfs clone functions

2018-10-10 Thread Darrick J. Wong
From: Darrick J. Wong Plumb a remap_flags argument through the {do,vfs}_clone_file_range functions so that clone can take advantage of it. Signed-off-by: Darrick J. Wong Reviewed-by: Amir Goldstein --- fs/ioctl.c |2 +- fs/nfsd/vfs.c |2 +- fs/overlayfs/copy_up.c

[PATCH 09/25] vfs: rename clone_verify_area to remap_verify_area

2018-10-10 Thread Darrick J. Wong
From: Darrick J. Wong Since we use clone_verify_area for both clone and dedupe range checks, rename the function to make it clear that it's for both. Signed-off-by: Darrick J. Wong Reviewed-by: Amir Goldstein --- fs/read_write.c | 10 +- 1 file changed, 5 insertions(+), 5 deletions

[PATCH 06/25] vfs: skip zero-length dedupe requests

2018-10-10 Thread Darrick J. Wong
From: Darrick J. Wong Don't bother calling the filesystem for a zero-length dedupe request; we can return zero and exit. Signed-off-by: Darrick J. Wong Reviewed-by: Christoph Hellwig Reviewed-by: Amir Goldstein --- fs/read_write.c |5 + 1 file changed, 5 insertions(+) diff --git

[PATCH 08/25] vfs: rename vfs_clone_file_prep to be more descriptive

2018-10-10 Thread Darrick J. Wong
From: Darrick J. Wong The vfs_clone_file_prep is a generic function to be called by filesystem implementations only. Rename the prefix to generic_ and make it more clear that it applies to remap operations, not just clones. Signed-off-by: Darrick J. Wong Reviewed-by: Amir Goldstein --- fs

[PATCH 07/25] vfs: combine the clone and dedupe into a single remap_file_range

2018-10-10 Thread Darrick J. Wong
From: Darrick J. Wong Combine the clone_file_range and dedupe_file_range operations into a single remap_file_range file operation dispatch since they're fundamentally the same operation. The differences between the two can be made in the prep functions. Signed-off-by: Darrick J. Wong Reviewed

[PATCH 10/25] vfs: create generic_remap_file_range_touch to update inode metadata

2018-10-10 Thread Darrick J. Wong
From: Darrick J. Wong Create a new VFS helper to handle inode metadata updates when remapping into a file. If the operation can possibly alter the file contents, we must update the ctime and mtime and remove security privileges, just like we do for regular file writes. Wire up ocfs2 to ensure

[PATCH 05/25] vfs: avoid problematic remapping requests into partial EOF block

2018-10-10 Thread Darrick J. Wong
From: Darrick J. Wong A deduplication data corruption is exposed by fstests generic/505 on XFS. It is caused by extending the block match range to include the partial EOF block, but then allowing unknown data beyond EOF to be considered a "match" to data in the destination fi

[PATCH 03/25] vfs: check file ranges before cloning files

2018-10-10 Thread Darrick J. Wong
From: Darrick J. Wong Move the file range checks from vfs_clone_file_prep into a separate generic_remap_checks function so that all the checks are collected in a central location. This forms the basis for adding more checks from generic_write_checks that will make cloning's input checking more

[PATCH 02/25] vfs: vfs_clone_file_prep_inodes should return EINVAL for a clone from beyond EOF

2018-10-10 Thread Darrick J. Wong
From: Darrick J. Wong vfs_clone_file_prep_inodes cannot return 0 if it is asked to remap from a zero byte file because that's what btrfs does. Signed-off-by: Darrick J. Wong --- fs/read_write.c |3 --- 1 file changed, 3 deletions(-) diff --git a/fs/read_write.c b/fs/read_write.c index

[PATCH 04/25] vfs: strengthen checking of file range inputs to generic_remap_checks

2018-10-10 Thread Darrick J. Wong
From: Darrick J. Wong File range remapping, if allowed to run past the destination file's EOF, is an optimization on a regular file write. Regular file writes that extend the file length are subject to various constraints which are not checked by range cloning. This is a correctness problem

[PATCH v3 00/25] fs: fixes for serious clone/dedupe problems

2018-10-10 Thread Darrick J. Wong
Hi all, Dave, Eric, and I have been chasing a stale data exposure bug in the XFS reflink implementation, and tracked it down to reflink forgetting to do some of the file-extending activities that must happen for regular writes. We then started auditing the clone, dedupe, and copyfile code and

[PATCH 01/25] xfs: add a per-xfs trace_printk macro

2018-10-10 Thread Darrick J. Wong
From: Darrick J. Wong Add a "xfs_tprintk" macro so that developers can use trace_printk to print out arbitrary debugging information with the XFS device name attached to the trace output. Signed-off-by: Darrick J. Wong --- fs/xfs/xfs_error.h |6 ++ 1 file changed, 6

Re: cross-fs copy support

2018-10-02 Thread Darrick J. Wong
On Tue, Oct 02, 2018 at 10:15:44AM +0200, David Sterba wrote: > On Mon, Oct 01, 2018 at 01:51:09PM -0600, Andreas Dilger wrote: > > > Yes, I would expect there to be problems with his modified kernel > > > for a filesystem that supports clone_file_range, because > > > vfs_copy_file_range() will

Re: [patch] file dedupe (and maybe clone) data corruption (was Re: [PATCH] generic: test for deduplication between different files)

2018-08-20 Thread Darrick J. Wong
On Mon, Aug 20, 2018 at 11:09:32AM +1000, Dave Chinner wrote: > [cc linux-fsdevel now, too] > > On Mon, Aug 20, 2018 at 09:11:26AM +1000, Dave Chinner wrote: > > [cc linux-...@vger.kernel.org] > > > > On Fri, Aug 17, 2018 at 09:39:24AM +0100, fdman...@kernel.org wrote: > > > From: Filipe Manana

Re: [RESEND][PATCH v4 0/2] vfs: better dedupe permission check

2018-07-17 Thread Darrick J. Wong
On Tue, Jul 17, 2018 at 12:09:04PM -0700, Mark Fasheh wrote: > Hi Al, > > The following patches fix a couple of issues with the permission check > we do in vfs_dedupe_file_range(). I sent them out for a few times now, > a changelog is attached. If they look ok to you, I'd appreciate them > being

Re: [PATCH v3 1/2] vfs: allow dedupe of user owned read-only files

2018-06-07 Thread Darrick J. Wong
uld get write access > > That way users can open read-only and still get dedupe. > > Signed-off-by: Mark Fasheh Looks ok, but could you please update the manpage for ioctl_fideduperange to elaborate on when userspace can expect EPERM? Acked-by: Darrick J. Wong --D > --- >

Re: [PATCH 11/12] xfs: convert to bioset_init()/mempool_init()

2018-05-21 Thread Darrick J. Wong
On Sun, May 20, 2018 at 06:25:57PM -0400, Kent Overstreet wrote: > Signed-off-by: Kent Overstreet <kent.overstr...@gmail.com> Looks ok, I guess... Acked-by: Darrick J. Wong <darrick.w...@oracle.com> --D > --- > fs/xfs/xfs_aops.c | 2 +- > fs/xfs/xfs_aops.h | 2 +- &g

Re: [PATCH v2 2/2] vfs: dedupe should return EPERM if permission is not granted

2018-05-18 Thread Darrick J. Wong
the case that the > filesystem does not support dedupe. > > Signed-off-by: Mark Fasheh <mfas...@suse.de> Looks ok what with all the okays after I squawked last time, Reviewed-by: Darrick J. Wong <darrick.w...@oracle.com> --D > --- > fs/read_write.c | 2 +- > 1 file changed,

Re: [PATCH v2 1/2] vfs: allow dedupe of user owned read-only files

2018-05-18 Thread Darrick J. Wong
On Fri, May 18, 2018 at 02:57:26PM -0700, Mark Fasheh wrote: > The permission check in vfs_dedupe_file_range() is too coarse - We > only allow dedupe of the destination file if the user is root, or > they have the file open for write. > > This effectively limits a non-root user from deduping

Re: [PATCH v2 5/5] generic: test invalid swap file activation

2018-05-18 Thread Darrick J. Wong
On Wed, May 16, 2018 at 01:38:49PM -0700, Omar Sandoval wrote: > From: Omar Sandoval > > Swap files cannot have holes, and they must at least two pages. > swapon(8) and mkswap(8) have stricter restrictions, so add versions of > those commands without any restrictions. > >

Re: [PATCH 14/14] mm: turn on vm_fault_t type checking

2018-05-16 Thread Darrick J. Wong
ricate problems with > sparse. > > Signed-off-by: Christoph Hellwig <h...@lst.de> > --- For the iomap and xfs parts, Reviewed-by: Darrick J. Wong <darrick.w...@oracle.com> That said... > diff --git a/include/linux/mm_types.h b/include/linux/mm_types.h > index 54f1e05ecf

Re: [PATCH 2/2] vfs: dedupe should return EPERM if permission is not granted

2018-05-13 Thread Darrick J. Wong
On Sun, May 13, 2018 at 06:21:52PM +, Mark Fasheh wrote: > On Fri, May 11, 2018 at 05:06:34PM -0700, Darrick J. Wong wrote: > > On Fri, May 11, 2018 at 12:26:51PM -0700, Mark Fasheh wrote: > > > Right now we return EINVAL if a process does not have permission to > &g

Re: [PATCH 1/2 V2] hoist BTRFS_IOC_[SG]ET_FSLABEL to vfs

2018-05-11 Thread Darrick J. Wong
On Fri, May 11, 2018 at 04:41:45PM +0200, David Sterba wrote: > On Fri, May 11, 2018 at 09:36:09AM -0500, Eric Sandeen wrote: > > On 5/11/18 9:32 AM, Chris Mason wrote: > > > On 11 May 2018, at 10:10, David Sterba wrote: > > > > > >> On Thu, May 10, 2018 at 08:16:09PM +0100, Al Viro wrote: > >

Re: [PATCH 2/2] vfs: dedupe should return EPERM if permission is not granted

2018-05-11 Thread Darrick J. Wong
On Fri, May 11, 2018 at 12:26:51PM -0700, Mark Fasheh wrote: > Right now we return EINVAL if a process does not have permission to dedupe a > file. This was an oversight on my part. EPERM gives a true description of > the nature of our error, and EINVAL is already used for the case that the >

Re: [PATCH 1/2] vfs: allow dedupe of user owned read-only files

2018-05-11 Thread Darrick J. Wong
eck so we allow dedupe on the target if: > > - the root or admin is asking for it > - the owner of the file is asking for the dedupe > - the process has write access > > Signed-off-by: Mark Fasheh <mfas...@suse.de> Sounds fine I guess Acked-by: Darrick J. Wong <darrick.w...@oracl

Re: [RFC v2 2/4] xfs: add verifier check for symlink with append/immutable flags

2018-05-10 Thread Darrick J. Wong
On Thu, May 10, 2018 at 04:13:57PM -0700, Luis R. Rodriguez wrote: > The Linux VFS does not allow a way to set append/immuttable attributes > to symlinks, this is just not possible. If this is detected we can > correct this with xfs_repair, so inform the user. > > Signed-off-by: Luis R. Rodriguez

Re: [PATCH 1/2] fs: hoist BTRFS_IOC_[SG]ET_FSLABEL to vfs

2018-05-09 Thread Darrick J. Wong
On Wed, May 09, 2018 at 11:15:46AM -0600, Andreas Dilger wrote: > On May 9, 2018, at 10:10 AM, Darrick J. Wong <darrick.w...@oracle.com> wrote: > > > > On Wed, May 09, 2018 at 11:01:21AM -0500, Eric Sandeen wrote: > >> Move the btrfs label ioctls

Re: [PATCH 2/2] man2: New page documenting filesystem get/set label ioctls

2018-05-09 Thread Darrick J. Wong
On Wed, May 09, 2018 at 11:04:03AM -0500, Eric Sandeen wrote: > This documents the proposed new vfs-level ioctls which can > get or set a mounted filesytem's label. > > Signed-off-by: Eric Sandeen > --- > > btrfs folks, please verify that this accurately describes your >

Re: [PATCH 1/2] fs: hoist BTRFS_IOC_[SG]ET_FSLABEL to vfs

2018-05-09 Thread Darrick J. Wong
; -#define FS_IOC_FSGETXATTR_IOR ('X', 31, struct fsxattr) > -#define FS_IOC_FSSETXATTR_IOW ('X', 32, struct fsxattr) > +#define FS_IOC_FSGETXATTR_IOR('X', 31, struct fsxattr) > +#define FS_IOC_FSSETXATTR_IOW('X', 32, struct fsxattr)

Re: btrfs-cleaner / snapshot performance analysis

2018-02-13 Thread Darrick J. Wong
On Sun, Feb 11, 2018 at 02:40:16PM +0800, Qu Wenruo wrote: > > > On 2018年02月10日 00:45, Ellis H. Wilson III wrote: > > Hi all, > > > > I am trying to better understand how the cleaner kthread (btrfs-cleaner) > > impacts foreground performance, specifically during snapshot deletion. > > My

Re: [PATCH RFC] Btrfs: expose bad chunks in sysfs

2018-02-08 Thread Darrick J. Wong
On Mon, Feb 05, 2018 at 04:15:02PM -0700, Liu Bo wrote: > Btrfs tries its best to tolerate write errors, but kind of silently > (except some messages in kernel log). > > For raid1 and raid10, this is usually not a problem because there is a > copy as backup, while for parity based raid setup,

Re: [PATCH v5 01/78] xfs: Rename xa_ elements to ail_

2018-01-02 Thread Darrick J. Wong
On Fri, Dec 15, 2017 at 02:03:33PM -0800, Matthew Wilcox wrote: > From: Matthew Wilcox <mawil...@microsoft.com> > > This is a simple rename, except that xa_ail becomes ail_head. > > Signed-off-by: Matthew Wilcox <mawil...@microsoft.com> That was an eyeful, R

Re: [PATCH v5 03/78] xarray: Add the xa_lock to the radix_tree_root

2018-01-02 Thread Darrick J. Wong
On Tue, Dec 26, 2017 at 07:58:15PM -0800, Matthew Wilcox wrote: > On Tue, Dec 26, 2017 at 07:43:40PM -0800, Matthew Wilcox wrote: > > Also add the xa_lock() and xa_unlock() family of wrappers to make it > > easier to use the lock. If we could rely on -fplan9-extensions in > > the

Re: [PATCH v4 14/19] xfs: convert to new i_version API

2017-12-22 Thread Darrick J. Wong
as I already let that horse escape I might as well clean it up separately. Looks ok, Acked-by: Darrick J. Wong <darrick.w...@oracle.com> --D > + > /* > * Check that none of the inode's in the buffer have a next > * unlinked field of 0. > @@ -264,7 +266,8 @

Re: [PATCH v4 17/19] xfs: avoid setting XFS_ILOG_CORE if i_version doesn't need incrementing

2017-12-22 Thread Darrick J. Wong
On Fri, Dec 22, 2017 at 07:05:54AM -0500, Jeff Layton wrote: > From: Jeff Layton <jlay...@redhat.com> > > If XFS_ILOG_CORE is already set then go ahead and increment it. > > Signed-off-by: Jeff Layton <jlay...@redhat.com> Looks ok, Acked-by: Darrick J. Wo

Re: [PATCH 1/4] Btrfs: btrfs_dedupe_file_range() ioctl, remove 16MiB restriction

2017-12-19 Thread Darrick J. Wong
On Tue, Dec 19, 2017 at 01:02:44PM +0300, Timofey Titovets wrote: > At now btrfs_dedupe_file_range() restricted to 16MiB range for > limit locking time and memory requirement for dedup ioctl() > > For too big input range code silently set range to 16MiB > > Let's remove that restriction by do

Re: [PATCH v9 0/5] Add the ability to do BPF directed error injection

2017-12-13 Thread Darrick J. Wong
On Wed, Dec 13, 2017 at 01:03:57PM -0500, Josef Bacik wrote: > On Tue, Dec 12, 2017 at 03:11:50PM -0800, Darrick J. Wong wrote: > > On Mon, Dec 11, 2017 at 11:36:45AM -0500, Josef Bacik wrote: > > > This is the same as v8, just rebased onto the bpf tree. > > > > &g

Re: [PATCH] fs/*/Kconfig: drop links to 404-compliant http://acl.bestbits.at

2017-12-12 Thread Darrick J. Wong
EISERFS_FS > help > Extended attributes are name:value pairs associated with inodes by > - the kernel or by users (see the attr(5) manual page, or visit > - <http://acl.bestbits.at/> for details). > + the kernel or by users (see the attr(5) manua

Re: [PATCH v9 0/5] Add the ability to do BPF directed error injection

2017-12-12 Thread Darrick J. Wong
On Mon, Dec 11, 2017 at 11:36:45AM -0500, Josef Bacik wrote: > This is the same as v8, just rebased onto the bpf tree. > > v8->v9: > - rebased onto the bpf tree. > > v7->v8: > - removed the _ASM_KPROBE_ERROR_INJECT since it was not needed. > > v6->v7: > - moved the opt-in macro to bpf.h out of

Re: [PATCH v2] iomap: report collisions between directio and buffered writes to userspace

2017-11-21 Thread Darrick J. Wong
gt; On Mon, Nov 20, 2017 at 05:37:53PM -0800, Darrick J. Wong wrote: > > > > > On Tue, Nov 21, 2017 at 09:27:49AM +1100, Dave Chinner wrote: > > > > > > First thing I noticed was that "xa" as a prefix is already quite > > > > > > wide

[PATCH v3] iomap: report collisions between directio and buffered writes to userspace

2017-11-21 Thread Darrick J. Wong
From: Darrick J. Wong <darrick.w...@oracle.com> If two programs simultaneously try to write to the same part of a file via direct IO and buffered IO, there's a chance that the post-diowrite pagecache invalidation will fail on the dirty page. When this happens, the dio write succeeded,

Re: [PATCH v2] iomap: report collisions between directio and buffered writes to userspace

2017-11-21 Thread Darrick J. Wong
On Tue, Nov 21, 2017 at 09:23:47AM -0800, Matthew Wilcox wrote: > On Tue, Nov 21, 2017 at 09:27:49AM +1100, Dave Chinner wrote: > > On Mon, Nov 20, 2017 at 01:51:00PM -0800, Matthew Wilcox wrote: > > > If you want an example of it in use, I'm pretty happy with this patch > > > that switches the

Re: [PATCH v2] iomap: report collisions between directio and buffered writes to userspace

2017-11-20 Thread Darrick J. Wong
gt; On Fri, Nov 17, 2017 at 11:39:25AM -0800, Darrick J. Wong wrote: > > > > > If two programs simultaneously try to write to the same part of a file > > > > > via direct IO and buffered IO, there's a chance that the post-diowrite > > > > > pageca

[PATCH v2] iomap: report collisions between directio and buffered writes to userspace

2017-11-17 Thread Darrick J. Wong
From: Darrick J. Wong <darrick.w...@oracle.com> If two programs simultaneously try to write to the same part of a file via direct IO and buffered IO, there's a chance that the post-diowrite pagecache invalidation will fail on the dirty page. When this happens, the dio write succeeded,

Re: [PATCH 2/3] btrfs: add a flags argument to LOGICAL_INO and call it LOGICAL_INO_V2

2017-09-21 Thread Darrick J. Wong
On Thu, Sep 21, 2017 at 04:16:35PM -0400, Zygo Blaxell wrote: > On Thu, Sep 21, 2017 at 12:59:42PM -0700, Darrick J. Wong wrote: > > On Thu, Sep 21, 2017 at 12:10:15AM -0400, Zygo Blaxell wrote: > > > Now that check_extent_in_eb()'s extent offset filter can be turned off, > &g

Re: [PATCH 2/3] btrfs: add a flags argument to LOGICAL_INO and call it LOGICAL_INO_V2

2017-09-21 Thread Darrick J. Wong
On Thu, Sep 21, 2017 at 12:10:15AM -0400, Zygo Blaxell wrote: > Now that check_extent_in_eb()'s extent offset filter can be turned off, > we need a way to do it from userspace. > > Add a 'flags' field to the btrfs_logical_ino_args structure to disable extent > offset filtering, taking the place

Re: [PATCH] btrfs: copy fsid to super_block s_uuid

2017-08-02 Thread Darrick J. Wong
On Wed, Aug 02, 2017 at 02:02:11PM +0800, Anand Jain wrote: > > Hi Darrick, > > Thanks for commenting.. > > >>+ memcpy(>s_uuid, fs_info->fsid, BTRFS_FSID_SIZE); > > > >uuid_copy()? > > It requires a larger migration to use uuid_t, IMO it can be done all > together, in a separate patch ?

Re: [PATCH] btrfs: copy fsid to super_block s_uuid

2017-08-01 Thread Darrick J. Wong
On Tue, Aug 01, 2017 at 06:35:08PM +0800, Anand Jain wrote: > We didn't copy fsid to struct super_block.s_uuid so Overlay disables > index feature with btrfs as the lower FS. > > kernel: overlayfs: fs on '/lower' does not support file handles, falling back > to index=off. > > Fix this by

Re: [PATCH v8 17/18] xfs: minimal conversion to errseq_t writeback error reporting

2017-06-29 Thread Darrick J. Wong
; > Signed-off-by: Jeff Layton <jlay...@redhat.com> Looks ok, Reviewed-by: Darrick J. Wong <darrick.w...@oracle.com> --D > --- > fs/xfs/xfs_file.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/fs/xfs/xfs_file.c b/fs/xfs/xfs_file.c &g

Re: [PATCH v8 12/18] Documentation: flesh out the section in vfs.txt on storing and reporting writeback errors

2017-06-29 Thread Darrick J. Wong
On Thu, Jun 29, 2017 at 09:19:48AM -0400, jlay...@kernel.org wrote: > From: Jeff Layton > > Let's try to make this extra clear for fs authors. > > Cc: Jan Kara > Signed-off-by: Jeff Layton > --- > Documentation/filesystems/vfs.txt | 43 >

Re: generic/015 run failed with btrfs

2017-06-27 Thread Darrick J. Wong
[cc linux-btrfs, drop linux-xfs cc] On Tue, Jun 27, 2017 at 07:42:16AM +, Dai, XiangX wrote: > Hi! I test on my host and find this issue, i want to know how can fix it? > > root@localhost ~/xfstests# ./check generic/015 > FSTYP -- btrfs ^ please contact the

Re: [PATCH v7 21/22] xfs: minimal conversion to errseq_t writeback error reporting

2017-06-26 Thread Darrick J. Wong
On Mon, Jun 26, 2017 at 01:58:32PM -0400, jlay...@redhat.com wrote: > On Mon, 2017-06-26 at 08:22 -0700, Darrick J. Wong wrote: > > On Fri, Jun 16, 2017 at 03:34:26PM -0400, Jeff Layton wrote: > > > Just check and advance the data errseq_t in struct file before > > >

Re: [PATCH v7 21/22] xfs: minimal conversion to errseq_t writeback error reporting

2017-06-26 Thread Darrick J. Wong
map_report_wb_err has side effects? Pre-coffee me was wondering why we'd bother calling filemap_report_wb_err in the XFS_FORCED_SHUTDOWN case, then remembered that it touches data structures. The first sentence of the commit message (really, the word 'advance') added as a comment was adequate to r

Re: [PATCH v6 19/20] xfs: minimal conversion to errseq_t writeback error reporting

2017-06-12 Thread Darrick J. Wong
On Mon, Jun 12, 2017 at 08:23:15AM -0400, Jeff Layton wrote: > Just set the FS_WB_ERRSEQ flag to indicate that we want to use errseq_t > based error reporting. Internal filemap_* calls are left as-is for now. > > Signed-off-by: Jeff Layton > --- > fs/xfs/xfs_super.c | 2 +- >

Re: crypto: Work around deallocated stack frame reference gcc bug on sparc.

2017-06-02 Thread Darrick J. Wong
[add ext4 list to cc] On Fri, Jun 02, 2017 at 11:28:54AM -0400, David Miller wrote: > > On sparc, if we have an alloca() like situation, as is the case with > SHASH_DESC_ON_STACK(), we can end up referencing deallocated stack > memory. The result can be that the value is clobbered if a trap >

Re: [PATCH 09/10] xfs: nowait aio support

2017-05-24 Thread Darrick J. Wong
needs allocation either due to file extension, writing to a hole, > or COW or waiting for other DIOs to finish. > > Signed-off-by: Goldwyn Rodrigues <rgold...@suse.com> > Reviewed-by: Christoph Hellwig <h...@lst.de> Looks good, Reviewed-by: Darrick J. Wong <darrick.w

Re: [PATCH RFC] vfs: add mount umount logs

2017-05-18 Thread Darrick J. Wong
On Thu, May 18, 2017 at 06:08:04PM +0800, Anand Jain wrote: > By looking at the logs we should be able to know when was the FS > mounted and unmounted and the options used, so to help forensic > investigations. > > Signed-off-by: Anand Jain > --- > You may want to know

[PATCH v2] ioctl_getfsmap.2: document the GETFSMAP ioctl

2017-05-17 Thread Darrick J. Wong
Document the new GETFSMAP ioctl that returns the physical layout of a (disk-based) filesystem. Signed-off-by: Darrick J. Wong <darrick.w...@oracle.com> --- v2: emphasize that filesystems are not obligated to return inode numbers --- man2/ioctl_getfsmap.2

Re: [PATCH] ioctl_getfsmap.2: document the GETFSMAP ioctl

2017-05-17 Thread Darrick J. Wong
On Sun, May 14, 2017 at 06:56:10AM -0700, Andy Lutomirski wrote: > On Sat, May 13, 2017 at 6:41 PM, Andreas Dilger <adil...@dilger.ca> wrote: > > On May 10, 2017, at 11:10 PM, Eric Biggers <ebigge...@gmail.com> wrote: > >> > >> On Wed, May 10, 2017 at

Re: [xfstests PATCH v2 2/3] ext4: allow ext4 to use $SCRATCH_LOGDEV

2017-05-15 Thread Darrick J. Wong
infrastructure for this (a'la $SCRATCH_LOGDEV), so wire > up the ext4 code so that it can do the same thing when _scratch_mkfs is > called. > > Signed-off-by: Jeff Layton <jlay...@redhat.com> Looks ok, Reviewed-by: Darrick J. Wong <darrick.w...@oracle.com> --D > --- > comm

Re: [PATCH] ioctl_getfsmap.2: document the GETFSMAP ioctl

2017-05-13 Thread Darrick J. Wong
On Sat, May 13, 2017 at 07:41:24PM -0600, Andreas Dilger wrote: > On May 10, 2017, at 11:10 PM, Eric Biggers <ebigge...@gmail.com> wrote: > > > > On Wed, May 10, 2017 at 01:14:37PM -0700, Darrick J. Wong wrote: > >> [cc btrfs, since afaict that's where most o

Re: [PATCH] ioctl_getfsmap.2: document the GETFSMAP ioctl

2017-05-10 Thread Darrick J. Wong
[cc btrfs, since afaict that's where most of the dedupe tool authors hang out] On Wed, May 10, 2017 at 02:27:33PM -0500, Eric W. Biederman wrote: > Theodore Ts'o writes: > > > On Tue, May 09, 2017 at 02:17:46PM -0700, Eric Biggers wrote: > >> 1.) Privacy implications. Say the

Re: [PATCH] fstests: generic: Check if cycle mount and sleep can affect fiemap result

2017-04-07 Thread Darrick J. Wong
On Fri, Apr 07, 2017 at 01:02:58PM +0800, Eryu Guan wrote: > On Thu, Apr 06, 2017 at 11:28:01AM -0500, Eric Sandeen wrote: > > On 4/6/17 11:26 AM, Theodore Ts'o wrote: > > > On Wed, Apr 05, 2017 at 10:35:26AM +0800, Eryu Guan wrote: > > >> > > >> Test fails with ext3/2 when driving with ext4

Re: [PATCH 7/8] nowait aio: xfs

2017-04-07 Thread Darrick J. Wong
On Fri, Apr 07, 2017 at 06:34:28AM -0500, Goldwyn Rodrigues wrote: > > > On 04/06/2017 05:54 PM, Darrick J. Wong wrote: > > On Mon, Apr 03, 2017 at 11:52:11PM -0700, Christoph Hellwig wrote: > >>> + if (unaligned_io) { > >>> + /* If we are goin

Re: [PATCH 7/8] nowait aio: xfs

2017-04-06 Thread Darrick J. Wong
On Mon, Apr 03, 2017 at 11:52:11PM -0700, Christoph Hellwig wrote: > > + if (unaligned_io) { > > + /* If we are going to wait for other DIO to finish, bail */ > > + if ((iocb->ki_flags & IOCB_NOWAIT) && > > +atomic_read(>i_dio_count)) > > +

Re: [PATCH] fstests: generic: Check if cycle mount and sleep can affect fiemap result

2017-04-03 Thread Darrick J. Wong
On Mon, Apr 03, 2017 at 03:09:23PM +0800, Qu Wenruo wrote: > As long as we don't modify the on-disk data, fiemap result should always > be constant. > > Operation like cycle mount and sleep should not affect fiemap result. > While unfortunately, btrfs doesn't follow that behavior. > > Btrfs

Re: [PATCH 3/4] reflink: test adjacency of reflinked blocks

2017-02-28 Thread Darrick J. Wong
On Tue, Feb 28, 2017 at 04:15:02PM +0800, Eryu Guan wrote: > On Fri, Feb 24, 2017 at 05:12:57PM -0800, Darrick J. Wong wrote: > > From: Darrick J. Wong <darrick.w...@oracle.com> > > > > If we reflink a file with N blocks to another file one block at a time, > >

[PATCH] ioctl_getfsmap.2: document the GETFSMAP ioctl

2017-02-21 Thread Darrick J. Wong
-by: Darrick J. Wong <darrick.w...@oracle.com> --- man2/ioctl_getfsmap.2 | 359 + 1 file changed, 359 insertions(+) create mode 100644 man2/ioctl_getfsmap.2 diff --git a/man2/ioctl_getfsmap.2 b/man2/ioctl_getfsmap.2 new file mode 100644 index 0

Re: [PATCH 4/6] xfs: use memalloc_nofs_{save,restore} instead of memalloc_noio*

2017-02-06 Thread Darrick J. Wong
On Mon, Feb 06, 2017 at 07:47:43PM +0100, Michal Hocko wrote: > On Mon 06-02-17 10:32:37, Darrick J. Wong wrote: > > On Mon, Feb 06, 2017 at 06:44:15PM +0100, Michal Hocko wrote: > > > On Mon 06-02-17 07:39:23, Matthew Wilcox wrote: > > > > On Mon, Feb 06, 2017 at

Re: [PATCH 4/6] xfs: use memalloc_nofs_{save,restore} instead of memalloc_noio*

2017-02-06 Thread Darrick J. Wong
On Mon, Feb 06, 2017 at 06:44:15PM +0100, Michal Hocko wrote: > On Mon 06-02-17 07:39:23, Matthew Wilcox wrote: > > On Mon, Feb 06, 2017 at 03:07:16PM +0100, Michal Hocko wrote: > > > +++ b/fs/xfs/xfs_buf.c > > > @@ -442,17 +442,17 @@ _xfs_buf_map_pages( > > > bp->b_addr = NULL; > > >

Re: [RFC][PATCH v2 4/4] vfs: wrap write f_ops with file_{start,end}_write()

2017-01-27 Thread Darrick J. Wong
[adding mfasheh & btrfs list to cc] On Fri, Jan 27, 2017 at 06:20:12PM +0200, Amir Goldstein wrote: > On Fri, Jan 27, 2017 at 1:50 PM, Amir Goldstein wrote: > > On Fri, Jan 27, 2017 at 1:09 PM, Miklos Szeredi wrote: > >> On Mon, Jan 23, 2017 at 8:43 PM,

Re: [Lsf-pc] [LSF/MM TOPIC] sharing pages between mappings

2017-01-11 Thread Darrick J. Wong
On Wed, Jan 11, 2017 at 12:51:43PM +0100, Jan Kara wrote: > On Wed 11-01-17 11:29:28, Miklos Szeredi wrote: > > I know there's work on this for xfs, but could this be done in generic mm > > code? > > > > What are the obstacles? page->mapping and page->index are the obvious > > ones. > > Yes,

Re: [RFC] Converging userspace and kernel code

2017-01-09 Thread Darrick J. Wong
On Mon, Jan 09, 2017 at 04:38:22PM -0500, Jeff Mahoney wrote: > On 1/9/17 4:34 PM, Omar Sandoval wrote: > > On Mon, Jan 09, 2017 at 09:31:39AM -0600, Eric Sandeen wrote: > >> On 1/8/17 8:11 PM, Qu Wenruo wrote: > >>> > >>> > >>> At 01/08/2017 09:16 PM, Goldwyn Rodrigues wrote: > > 1.

Re: [PATCH 2/8] xfs: abstract PF_FSTRANS to PF_MEMALLOC_NOFS

2017-01-09 Thread Darrick J. Wong
l API for it as xfs uses the flag directly > anyway. > > This patch doesn't introduce any functional change. > > Signed-off-by: Michal Hocko <mho...@suse.com> > Reviewed-by: Brian Foster <bfos...@redhat.com> Reviewed-by: Darrick J. Wong <darrick.w...@oracle.c

Re: [PATCH 4/8] xfs: use memalloc_nofs_{save,restore} instead of memalloc_noio*

2017-01-09 Thread Darrick J. Wong
ctly what we need here - implicit GFP_NOFS context. > > Changes since v1 > - s@memalloc_noio_restore@memalloc_nofs_restore@ in _xfs_buf_map_pages > as per Brian Foster > > Signed-off-by: Michal Hocko <mho...@suse.com> Reviewed-by: Darrick J. Wong <darrick.w...@orac

[PATCH v2] duperemove: test presence of dedupe ioctl

2017-01-05 Thread Darrick J. Wong
Since a zero-length dedupe operation is guaranteed to succeed, use that to test whether or not this filesystem supports dedupe. Signed-off-by: Darrick J. Wong <darrick.w...@oracle.com> --- v2: declare variables on the stack instead of introducing fake types --- file_scan.c

Re: [PATCH 2/9] xfs: introduce and use KM_NOLOCKDEP to silence reclaim lockdep false positives

2016-12-19 Thread Darrick J. Wong
On Tue, Dec 20, 2016 at 08:24:13AM +1100, Dave Chinner wrote: > On Thu, Dec 15, 2016 at 03:07:08PM +0100, Michal Hocko wrote: > > From: Michal Hocko > > > > Now that the page allocator offers __GFP_NOLOCKDEP let's introduce > > KM_NOLOCKDEP alias for the xfs allocation APIs.

[PATCH v2] duperemove: test presence of dedupe ioctl

2016-12-15 Thread Darrick J. Wong
Since a zero-length dedupe operation is guaranteed to succeed, use that to test whether or not this filesystem supports dedupe. Signed-off-by: Darrick J. Wong <darrick.w...@oracle.com> --- v2: Don't declare a new type; just declare the struct on the stack. --- file_scan.c

Re: [PATCH] duperemove: test presence of dedupe ioctl

2016-12-15 Thread Darrick J. Wong
On Wed, Dec 14, 2016 at 11:26:07AM -0800, Christoph Hellwig wrote: > On Wed, Dec 14, 2016 at 10:38:45AM -0800, Darrick J. Wong wrote: > > > > +struct fake_btrfs_ioctl_same_args { > > > > + struct btrfs_ioctl_same_args args; > > > > + s

Re: [PATCH] duperemove: test presence of dedupe ioctl

2016-12-14 Thread Darrick J. Wong
On Wed, Dec 14, 2016 at 02:44:36AM -0800, Christoph Hellwig wrote: > On Fri, Dec 09, 2016 at 09:56:45AM -0800, Darrick J. Wong wrote: > > Since a zero-length dedupe operation is guaranteed to succeed, use that > > to test whether or not this filesystem supports dedupe. >

Re: out-of-band dedup status?

2016-12-09 Thread Darrick J. Wong
[adding mark fasheh (duperemove maintainer) to cc] On Fri, Dec 09, 2016 at 07:29:21AM -0500, Austin S. Hemmelgarn wrote: > On 2016-12-08 21:54, Chris Murphy wrote: > >On Thu, Dec 8, 2016 at 7:26 PM, Darrick J. Wong <darrick.w...@oracle.com> > >wrote: > >>On Thu, De

[PATCH] duperemove: test presence of dedupe ioctl

2016-12-09 Thread Darrick J. Wong
Since a zero-length dedupe operation is guaranteed to succeed, use that to test whether or not this filesystem supports dedupe. Signed-off-by: Darrick J. Wong <darrick.w...@oracle.com> --- file_scan.c | 47 +-- 1 file changed, 37 insertions(

Re: out-of-band dedup status?

2016-12-08 Thread Darrick J. Wong
On Thu, Dec 08, 2016 at 05:45:40PM -0700, Chris Murphy wrote: > OK something's wrong. > > Kernel 4.8.12 and duperemove v0.11.beta4. Brand new file system > (mkfs.btrfs -dsingle -msingle, default mount options) and two > identical files separately copied. > > [chris@f25s]$ ls -li /mnt/test >

Re: [PATCH] generic/35[67]: disable swapfile tests on Btrfs

2016-12-06 Thread Darrick J. Wong
add it to these tests. Hehe, good catch. :) Reviewed-by: Darrick J. Wong <darrick.w...@oracle.com> --D > > Signed-off-by: Omar Sandoval <osan...@fb.com> > --- > I have some code enabling swapfiles for Btrfs [1], but there's some ABBA > deadlock issues with i_rwsem an

Re: [RFC PATCH 0/2] Btrfs: make a source length of 0 imply EOF for dedupe

2016-11-28 Thread Darrick J. Wong
On Thu, Nov 24, 2016 at 11:20:39PM -0500, Zygo Blaxell wrote: > On Wed, Nov 23, 2016 at 05:26:18PM -0800, Darrick J. Wong wrote: > [...] > > Keep in mind that the number of bytes deduped is returned to userspace > > via file_dedupe_range.info[x].bytes_deduped, so a pr

Re: [RFC PATCH 0/2] Btrfs: make a source length of 0 imply EOF for dedupe

2016-11-23 Thread Darrick J. Wong
On Thu, Nov 24, 2016 at 10:53:24AM +1100, Dave Chinner wrote: > On Wed, Nov 23, 2016 at 06:14:47PM -0500, Zygo Blaxell wrote: > > On Thu, Nov 24, 2016 at 09:13:28AM +1100, Dave Chinner wrote: > > > On Wed, Nov 23, 2016 at 08:55:59AM -0500, Zygo Blaxell wrote: > > > > On Wed, Nov 23, 2016 at

  1   2   3   4   5   >