[PATCH, maybe WRONG] btrfs: don't let btrfs_recover_relocation get stuck waiting for cleaner_kthread to delete a snapshot

2016-05-03 Thread Zygo Blaxell
This is one way to fix a long hang during mounts. There's probably a better way, but this is the one I've used to get my filesystems up and running. We start the cleaner kthread first because the transaction kthread wants to wake up the cleaner kthread. We start the transaction kthread next beca

Re: [PATCH 0/2] scop GFP_NOFS api

2016-05-03 Thread Dave Chinner
On Sun, May 01, 2016 at 08:19:44AM +1000, NeilBrown wrote: > On Sat, Apr 30 2016, Dave Chinner wrote: > > Indeed, blocking the superblock shrinker in reclaim is a key part of > > balancing inode cache pressure in XFS. If the shrinker starts > > hitting dirty inodes, it blocks on cleaning them, ther

Re: [PATCH 2/2] Btrfs: add valid checks for chunk loading

2016-05-03 Thread Liu Bo
On Tue, May 03, 2016 at 09:12:01AM +0800, Qu Wenruo wrote: > > > Liu Bo wrote on 2016/05/02 11:15 -0700: > >To prevent fuzz filesystem images from panic the whole system, > >we need various validation checks to refuse to mount such an image > >if btrfs finds any invalid value during loading chunk

Re: [PATCH 1/2] Btrfs: add more valid checks for superblock

2016-05-03 Thread Liu Bo
On Tue, May 03, 2016 at 09:02:56AM +0800, Qu Wenruo wrote: > > > Liu Bo wrote on 2016/05/02 11:15 -0700: > >This adds valid checks for super_total_bytes, super_bytes_used and > >super_stripesize. > > > >Reported-by: Vegard Nossum > >Reported-by: Quentin Casasnovas > >Signed-off-by: Liu Bo > >-

Re: [PATCH 2/2] Btrfs: add valid checks for chunk loading

2016-05-03 Thread Liu Bo
On Tue, May 03, 2016 at 01:53:02PM +0800, Anand Jain wrote: > > > > On 05/03/2016 02:15 AM, Liu Bo wrote: > >To prevent fuzz filesystem images from panic the whole system, > >we need various validation checks to refuse to mount such an image > >if btrfs finds any invalid value during loading chu

Re: [PATCH v2] btrfs: cleanup assigning next active device with a check

2016-05-03 Thread Anand Jain
While here can also integrate this. [PATCH 1/1] btrfs: fix lock dep warning move scratch super outside of chunk_mutex That one has been in for-next for some time. There is another patch which is similarly named (sorry about that), I see that one but not this. - git log -i --a

Re: [PATCH] Btrfs: fix unexpected balance crash due to BUG_ON

2016-05-03 Thread Liu Bo
On Wed, May 04, 2016 at 01:14:27AM +0200, Holger Hoffstätte wrote: > On Tue, May 3, 2016 at 1:01 AM, Liu Bo wrote: > > Mounting a btrfs can resume previous balance operations asynchronously. > > An user got a crash when one drive has some corrupt sectors. > > > > Since balance can cancel itself in

Re: [PATCH 0/2] scop GFP_NOFS api

2016-05-03 Thread NeilBrown
On Wed, May 04 2016, Michal Hocko wrote: > Hi, > > On Sun 01-05-16 07:55:31, NeilBrown wrote: > [...] >> One particular problem with your process-context idea is that it isn't >> inherited across threads. >> Steve Whitehouse's example in gfs shows how allocation dependencies can >> even cross into

Re: [PATCH] Btrfs: fix unexpected balance crash due to BUG_ON

2016-05-03 Thread Holger Hoffstätte
On Tue, May 3, 2016 at 1:01 AM, Liu Bo wrote: > Mounting a btrfs can resume previous balance operations asynchronously. > An user got a crash when one drive has some corrupt sectors. > > Since balance can cancel itself in case of any error, we can gracefully > return errors to upper layers and let

Re: [PATCH 00/42] v7: separate operations from flags in the bio/request structs

2016-05-03 Thread Jeff Moyer
mchri...@redhat.com writes: > The following patches begin to cleanup the request->cmd_flags and > bio->bi_rw mess. We currently use cmd_flags to specify the operation, > attributes and state of the request. For bi_rw we use it for similar > info and also the priority but then also have another bi_

Re: RAID56 device replace/rebalance error: bad page state

2016-05-03 Thread Goffredo Baroncelli
On 2016-05-02 20:33, Yauhen Kharuzhy wrote: > Hi. > > While testing of various scenarios of RAID5 recovery I got kernel > messages about bad page state with soft lockup afterwards. Looking at your script, I found a little bug: [...] for i in `seq $n -1 $((n-2))`; do d=`basename ${DISKS[$

Re: [PATCH] btrfs: s_bdev is not null after missing replace

2016-05-03 Thread Yauhen Kharuzhy
On Tue, May 03, 2016 at 11:34:50PM +0300, Yauhen Kharuzhy wrote: > On Tue, May 03, 2016 at 07:31:48PM +0200, David Sterba wrote: > > On Thu, Apr 14, 2016 at 06:24:10PM +0800, Anand Jain wrote: > > > Yauhen reported in the ML that s_bdev is null at mount, and > > > s_bdev gets updated to some device

Re: [PATCH] btrfs: s_bdev is not null after missing replace

2016-05-03 Thread Yauhen Kharuzhy
On Tue, May 03, 2016 at 07:31:48PM +0200, David Sterba wrote: > On Thu, Apr 14, 2016 at 06:24:10PM +0800, Anand Jain wrote: > > Yauhen reported in the ML that s_bdev is null at mount, and > > s_bdev gets updated to some device when missing device is > > replaced, as because bdev is null for missing

Re: receive snapshot, complains about missing file

2016-05-03 Thread Alexander Fougner
2016-04-30 13:28 GMT+02:00 Duncan <1i5t5.dun...@cox.net>: > Alexander Fougner posted on Sat, 30 Apr 2016 12:55:06 +0200 as excerpted: > Receive side only outputs this: sudo btrfs check -p /dev/sdc Couldn't open file system >>> >>> It wasn't mounted at the time, right? >> >> Nope >> >> >>>

Re: Subvolumes cannot be mounted after raid1 conversion

2016-05-03 Thread hasse
Den 03/05/16 kl. 20:31 skrev ha...@hagenjohansen.dk: > Den 03/05/16 kl. 18:30 skrev Duncan: >> Hugo Mills posted on Tue, 03 May 2016 10:27:46 + as excerpted: >> >>> Given those symptoms (mount doesn't report errors, but no mount >>> happens), I would guess that your problem is with systemd. It

Re: Subvolumes cannot be mounted after raid1 conversion

2016-05-03 Thread hasse
Den 03/05/16 kl. 18:30 skrev Duncan: > Hugo Mills posted on Tue, 03 May 2016 10:27:46 + as excerpted: > >> Given those symptoms (mount doesn't report errors, but no mount >> happens), I would guess that your problem is with systemd. It has a bug >> where it sometimes unmounts things immediatel

Re: btrfs goes readonly + No space left on 4.3

2016-05-03 Thread Omar Sandoval
On Tue, May 03, 2016 at 04:06:05AM +, Paul Jones wrote: > > -Original Message- > > From: linux-btrfs-ow...@vger.kernel.org [mailto:linux-btrfs- > > ow...@vger.kernel.org] On Behalf Of Omar Sandoval > > Sent: Tuesday, 3 May 2016 8:06 AM > > To: Stefan Priebe > > Cc: linux-btrfs@vger.ker

Re: Subvolumes cannot be mounted after raid1 conversion

2016-05-03 Thread hasse
Den 03/05/16 kl. 13:13 skrev Hasse Hagen Johansen: >>> >>> The exact thing I did was having the subvols mounted. Then mounted >> top-level volume on /mbt/temp. And then ran balance to convert to >> raid1.. When finished I umounted /mnt/temp (the top-level) and then my >> 3 subvolumes was unmounted

Re: [PATCH v2] btrfs: cleanup assigning next active device with a check

2016-05-03 Thread David Sterba
On Tue, May 03, 2016 at 06:01:31PM +0800, Anand Jain wrote: > > > On 05/02/2016 11:26 PM, David Sterba wrote: > > On Mon, May 02, 2016 at 07:02:08AM +0800, Anand Jain wrote: > >> --- a/fs/btrfs/dev-replace.c > >> +++ b/fs/btrfs/dev-replace.c > >> @@ -569,11 +569,9 @@ static int btrfs_dev_replace_

Re: [PATCH] btrfs: s_bdev is not null after missing replace

2016-05-03 Thread David Sterba
On Thu, Apr 14, 2016 at 06:24:10PM +0800, Anand Jain wrote: > Yauhen reported in the ML that s_bdev is null at mount, and > s_bdev gets updated to some device when missing device is > replaced, as because bdev is null for missing device, things > gets matched up. Fix this by checking if s_bdev is s

Re: Subvolumes cannot be mounted after raid1 conversion

2016-05-03 Thread Duncan
Hugo Mills posted on Tue, 03 May 2016 10:27:46 + as excerpted: > Given those symptoms (mount doesn't report errors, but no mount > happens), I would guess that your problem is with systemd. It has a bug > where it sometimes unmounts things immediately after you've mounted > them. FWIW, I have

[PATCH 0/3] Btrfs-progs: fix unaligned acces for ioctl search header

2016-05-03 Thread David Sterba
A user reports that some commands fail with SIGBUS on SPARC, due to unaligned access. We should really use the helpers as the search header data are read from a random position in the buffer that's returned from the TREE_SEARCH ioctl. David Sterba (3): btrfs-progs: kerncompat: introduce get_unal

[PATCH 1/3] btrfs-progs: kerncompat: introduce get_unaligned helpers

2016-05-03 Thread David Sterba
Signed-off-by: David Sterba --- kerncompat.h | 4 1 file changed, 4 insertions(+) diff --git a/kerncompat.h b/kerncompat.h index ee65aa72ad6d..574f468226c2 100644 --- a/kerncompat.h +++ b/kerncompat.h @@ -334,12 +334,16 @@ struct __una_u32 { __le32 x; } __attribute__((__packed__)); struct

[PATCH 3/3] btrfs-progs: use ioctl search headers everywhere

2016-05-03 Thread David Sterba
Generated by following semantic patch and manually tweaked. @@ struct btrfs_ioctl_search_header *SH; @@ ( - SH->objectid + btrfs_search_header_objectid(SH) | - SH->offset + btrfs_search_header_offset(SH) | - SH->transid + btrfs_search_header_transid(SH) | - SH->len + btrfs_search_header_len(SH) |

[PATCH 2/3] btrfs-progs: add getters for ioctl search_header

2016-05-03 Thread David Sterba
The search header is usually accessed in an unaligned way, we could trigger errors (SIGBUS) on architectures that do not support that. Signed-off-by: David Sterba --- ctree.h | 26 ++ 1 file changed, 26 insertions(+) diff --git a/ctree.h b/ctree.h index 2da6f7786a78..13e

Re: commands like "du", "df", and "btrfs fs sync" hang

2016-05-03 Thread Duncan
Austin S. Hemmelgarn posted on Mon, 02 May 2016 09:13:41 -0400 as excerpted: >> Direct from that section of my /etc/sysctl.conf: >> >> >> # write-cache, foreground/background flushing >> # vm.dirty_ratio = 10 (% of RAM) >> # make it 3% of 16G ~ half a gig >> vm.dirty_ratio = 3 >> # vm.dirty_byt

Re: [PATCH 0/2] scop GFP_NOFS api

2016-05-03 Thread Michal Hocko
Hi, On Sun 01-05-16 07:55:31, NeilBrown wrote: [...] > One particular problem with your process-context idea is that it isn't > inherited across threads. > Steve Whitehouse's example in gfs shows how allocation dependencies can > even cross into user space. Hmm, I am still not sure I understand t

Re: Subvolumes cannot be mounted after raid1 conversion

2016-05-03 Thread Hasse Hagen Johansen
Ok. Thanks for the info. I will look into it some more and return when I find out what happens. Thanks for the help until now On 3. maj 2016 12.27.46 CEST, Hugo Mills wrote: >On Tue, May 03, 2016 at 12:24:52PM +0200, Hasse Hagen Johansen wrote: >> Ok. I can mount it manually just fine now usin

Re: Subvolumes cannot be mounted after raid1 conversion

2016-05-03 Thread Hugo Mills
On Tue, May 03, 2016 at 12:24:52PM +0200, Hasse Hagen Johansen wrote: > Ok. I can mount it manually just fine now using this command : sudo mount -t > btrfs -o subvol=music /dev/sde /mnt/temp > > But somehow I cannot mount it at /music anymore(and I just found out that is > what has been tricki

Re: Subvolumes cannot be mounted after raid1 conversion

2016-05-03 Thread Hasse Hagen Johansen
Ok. I can mount it manually just fine now using this command : sudo mount -t btrfs -o subvol=music /dev/sde /mnt/temp But somehow I cannot mount it at /music anymore(and I just found out that is what has been tricking me) I have also tried with this in fstab /dev/sde /music btrfs

Re: [PATCH v2] btrfs: cleanup assigning next active device with a check

2016-05-03 Thread Anand Jain
On 05/02/2016 11:26 PM, David Sterba wrote: On Mon, May 02, 2016 at 07:02:08AM +0800, Anand Jain wrote: --- a/fs/btrfs/dev-replace.c +++ b/fs/btrfs/dev-replace.c @@ -569,11 +569,9 @@ static int btrfs_dev_replace_finishing(struct btrfs_fs_info *fs_info, ASSERT(list_empty(&src_device->r

Re: Subvolumes cannot be mounted after raid1 conversion

2016-05-03 Thread Hugo Mills
On Tue, May 03, 2016 at 10:52:36AM +0200, Hasse Hagen Johansen wrote: > Hi > > I have made a btrfs on a single physical disk and made 3 subvolumes which I > manually mounted and copied data to. Yesterday I added another disk to the > filesystem and ran btrfs balance start -mconvert=raid1 -dconve

Re: recovery problem raid5

2016-05-03 Thread Pierre-Matthieu anglade
On Sat, Apr 30, 2016 at 1:25 AM, Duncan <1i5t5.dun...@cox.net> wrote: > Pierre-Matthieu anglade posted on Fri, 29 Apr 2016 11:24:12 + as > excerpted: > So while btrfs in general, being still not yet fully stable, isn't yet > really recommended unless you're using data you can afford to lose, >

[PATCH] btrfs: cleanup assigning next active device with a check

2016-05-03 Thread Anand Jain
Creates helper fucntion as needed by the device delete and replace operations. Also now it checks if the next device being assigned is an active device. Signed-off-by: Anand Jain --- v3: fix compile warning, use ASSERT, minor comment update, based on for-next v2: added comments, and BUG_ON if w

Subvolumes cannot be mounted after raid1 conversion

2016-05-03 Thread Hasse Hagen Johansen
Hi I have made a btrfs on a single physical disk and made 3 subvolumes which I manually mounted and copied data to. Yesterday I added another disk to the filesystem and ran btrfs balance start -mconvert=raid1 -dconvert=raid1 /mnt/temp where /mnt/temp is top-level fimesystem(not the subvolumes).

Debian BTRFS/UEFI Documentation

2016-05-03 Thread David Alcorn
"Honestly, did you read the Debian wiki pages for btrfs and EFI? If you read them, could you please let me know where they were deficient so I can fix them?" I did not use the Debian wiki pages for BTRFS and UEFI as a resource in my attempts to answer my questions because I read them in the past