Re: [RFC PATCH v4 6/6] Btrfs: support swap files

2018-05-25 Thread Omar Sandoval
On Fri, May 25, 2018 at 01:07:00PM +0300, Nikolay Borisov wrote: > > > On 25.05.2018 00:41, Omar Sandoval wrote: > > From: Omar Sandoval > > > > Implement the swap file a_ops on Btrfs. Activation needs to make sure > > that the file can be used as a swap file, which currently means it must > >

Re: [RFC PATCH v4 4/6] Btrfs: prevent ioctls from interfering with a swap file

2018-05-25 Thread David Sterba
On Fri, May 25, 2018 at 09:00:58AM -0700, Omar Sandoval wrote: > On Fri, May 25, 2018 at 04:50:55PM +0200, David Sterba wrote: > > On Thu, May 24, 2018 at 02:41:28PM -0700, Omar Sandoval wrote: > > > From: Omar Sandoval > > > > > > When a swap file is active, we must make sure that the extents of

Re: [PATCH v2] Btrfs: add parent_transid parameter to veirfy_level_key

2018-05-25 Thread David Sterba
On Fri, May 18, 2018 at 01:10:59PM +0800, Qu Wenruo wrote: > > > On 2018年05月18日 13:02, Nikolay Borisov wrote: > > > > > > On 18.05.2018 05:59, Liu Bo wrote: > >> As verify_level_key() is checked after verify_parent_transid(), i.e. > >> > >> if (verify_parent_transid()) > >>ret = -EIO; > >>

Re: [RFC PATCH v4 5/6] Btrfs: rename get_chunk_map() and make it non-static

2018-05-25 Thread Omar Sandoval
On Fri, May 25, 2018 at 12:21:41PM +0300, Nikolay Borisov wrote: > > > On 25.05.2018 00:41, Omar Sandoval wrote: > > From: Omar Sandoval > > > > The Btrfs swap code is going to need it, so give it a btrfs_ prefix and > > make it non-static. > > > > Signed-off-by: Omar Sandoval > > Reviewed-b

Re: [RFC PATCH v4 4/6] Btrfs: prevent ioctls from interfering with a swap file

2018-05-25 Thread Omar Sandoval
On Fri, May 25, 2018 at 04:50:55PM +0200, David Sterba wrote: > On Thu, May 24, 2018 at 02:41:28PM -0700, Omar Sandoval wrote: > > From: Omar Sandoval > > > > When a swap file is active, we must make sure that the extents of the > > file are not moved and that they don't become shared. That means

Re: [PATCH v3] btrfs: drop uuid_mutex in btrfs_free_extra_devids()

2018-05-25 Thread David Sterba
On Wed, May 23, 2018 at 10:54:22AM +0800, Anand Jain wrote: > btrfs_free_extra_devids() is called only in the mount context which > traverses through the fs_devices::devices and frees the orphan devices > devices in the given %fs_devices if any. As the search for the orphan > device is limited to f

Re: [PATCH v4 3/3] btrfs: Do super block verification before writing it to disk

2018-05-25 Thread David Sterba
On Fri, May 25, 2018 at 12:43:25PM +0800, Qu Wenruo wrote: > Reported-by: Ken Swenson > Reported-by: Ben Parsons <9parso...@gmail.com> > Signed-off-by: Qu Wenruo > --- > fs/btrfs/disk-io.c | 43 +++ > 1 file changed, 43 insertions(+) > > diff --git a/fs/b

Re: [RFC PATCH v4 4/6] Btrfs: prevent ioctls from interfering with a swap file

2018-05-25 Thread David Sterba
On Thu, May 24, 2018 at 02:41:28PM -0700, Omar Sandoval wrote: > From: Omar Sandoval > > When a swap file is active, we must make sure that the extents of the > file are not moved and that they don't become shared. That means that > the following are not safe: > > - chattr +c (enable compression

[josef-btrfs:blk-iolatency 6/13] common.c:undefined reference to `blkcg_maybe_throttle_current'

2018-05-25 Thread kbuild test robot
tree: https://git.kernel.org/pub/scm/linux/kernel/git/josef/btrfs-next.git blk-iolatency head: 6bbc4451bcc7359b14e190615ff671fd63e34d62 commit: 605adede5ce998f9e834c1783e74dc0660b346db [6/13] blkcg: add generic throttling mechanism config: i386-tinyconfig (attached as .config) compiler: gcc-7

[josef-btrfs:blk-iolatency 7/13] include/linux/blkdev.h:2092:9: note: in expansion of macro 'NULL'

2018-05-25 Thread kbuild test robot
tree: https://git.kernel.org/pub/scm/linux/kernel/git/josef/btrfs-next.git blk-iolatency head: 6bbc4451bcc7359b14e190615ff671fd63e34d62 commit: e13e26d1ad161949ae1fdd02623c2d81a666328e [7/13] memcontrol: schedule throttling if we are congested config: x86_64-randconfig-x018-201820 (attached a

Re: [PATCH] btrfs: qgroup: More meaningful qgroup_rescan_init error message

2018-05-25 Thread David Sterba
On Wed, May 02, 2018 at 01:28:03PM +0800, Qu Wenruo wrote: > Error message from qgroup_rescan_init() mostly looks like: > > -- > BTRFS info (device nvme0n1p1): qgroup_rescan_init failed with -115 > -- > > Which is far from meaningful, and sometimes confusing as for above > -EINPROGRESS it

Re: [RFC PATCH v2 00/12] get rid of GFP_ZONE_TABLE/BAD

2018-05-25 Thread Matthew Wilcox
On Thu, May 24, 2018 at 05:29:43PM +0200, Michal Hocko wrote: > > ie if we had more, > > could we solve our pain by making them more generic? > > Well, if you have more you will consume more bits in the struct pages, > right? Not necessarily ... the zone number is stored in the struct page curren

Re: [RFC PATCH v4 6/6] Btrfs: support swap files

2018-05-25 Thread Nikolay Borisov
On 25.05.2018 00:41, Omar Sandoval wrote: > From: Omar Sandoval > > Implement the swap file a_ops on Btrfs. Activation needs to make sure > that the file can be used as a swap file, which currently means it must > be fully allocated as nocow with no compression on one device. It also > sets up

RE: [External] Re: [RFC PATCH v2 00/12] get rid of GFP_ZONE_TABLE/BAD

2018-05-25 Thread Huaisheng HS1 Ye
From: Michal Hocko [mailto:mho...@kernel.org] Sent: Thursday, May 24, 2018 8:19 PM> > > Let me try to reply your questions. > > Exactly, GFP_ZONE_TABLE is too complicated. I think there are two advantages > > from the series of patches. > > > > 1. XOR operation is simple and efficient, GFP_ZONE_TA

Re: [RFC PATCH v4 5/6] Btrfs: rename get_chunk_map() and make it non-static

2018-05-25 Thread Nikolay Borisov
On 25.05.2018 00:41, Omar Sandoval wrote: > From: Omar Sandoval > > The Btrfs swap code is going to need it, so give it a btrfs_ prefix and > make it non-static. > > Signed-off-by: Omar Sandoval Reviewed-by: Nikolay Borisov nit: How about introducing proper kernel doc for this function, no

Re: [RFC PATCH v4 3/6] Btrfs: push EXCL_OP set into btrfs_rm_device()

2018-05-25 Thread Nikolay Borisov
On 25.05.2018 00:41, Omar Sandoval wrote: > From: Omar Sandoval > > btrfs_ioctl_rm_dev() and btrfs_ioctl_rm_dev_v2() both manipulate this > bit. Let's move it into the common btrfs_rm_device(), which also makes > the following change to deal with swap files easier. > > Signed-off-by: Omar Sand

Re: [RFC PATCH v4 2/6] vfs: update swap_{,de}activate documentation

2018-05-25 Thread Nikolay Borisov
On 25.05.2018 00:41, Omar Sandoval wrote: > From: Omar Sandoval > > The documentation for these functions is wrong in several ways: > > - swap_activate() is called with the inode locked > - swap_activate() takes a swap_info_struct * and a sector_t * > - swap_activate() can also return a positi

Re: [RFC PATCH v4 1/6] mm: split SWP_FILE into SWP_ACTIVATED and SWP_FS

2018-05-25 Thread Nikolay Borisov
On 25.05.2018 00:41, Omar Sandoval wrote: > From: Omar Sandoval > > The SWP_FILE flag serves two purposes: to make swap_{read,write}page() > go through the filesystem, and to make swapoff() call > ->swap_deactivate(). For Btrfs, we want the latter but not the former, > so split this flag into t

Re: [PATCH v4 3/3] btrfs: Do super block verification before writing it to disk

2018-05-25 Thread Qu Wenruo
On 2018年05月25日 14:33, Nikolay Borisov wrote: > > > On 25.05.2018 07:43, Qu Wenruo wrote: >> There are already 2 reports about strangely corrupted super blocks, >> where csum still matches but extra garbage gets slipped into super block. >> >> The corruption would looks like: >> -- >> superb