Re: [PATCH] btrfs: Fix UAF

2018-01-28 Thread Nikolay Borisov
On 29.01.2018 04:38, Anand Jain wrote: > > > On 01/26/2018 09:20 PM, Nikolay Borisov wrote: >> Commit 4fde46f0cc71 ("Btrfs: free the stale device") introduced >> btrfs_free_stale_device which iterates the device lists for all >> registered btrfs filesystems and deletes those devices which

Re: [PATCH v3 00/17] btrfs-progs: lowmem check: avoid extents overwrite

2018-01-28 Thread Su Yue
Just ping since some patches are meaningful for further fixes. On 01/11/2018 03:34 PM, Su Yue wrote: This patchset can be fetched from my github: https://github.com/Damenly/btrfs-progs/tree/lowmem based on kdave/devel. It can be rebased to kdave/master now but not changing kdave/devel. And

Re: [PATCH] btrfs: Fix UAF

2018-01-28 Thread Anand Jain
On 01/26/2018 09:20 PM, Nikolay Borisov wrote: Commit 4fde46f0cc71 ("Btrfs: free the stale device") introduced btrfs_free_stale_device which iterates the device lists for all registered btrfs filesystems and deletes those devices which aren't mounted. In a btrfs_devices structure has only 1

Re: [PATCH 02/26] Add libbtrfsutil

2018-01-28 Thread Qu Wenruo
On 2018年01月27日 02:40, Omar Sandoval wrote: > From: Omar Sandoval > > Currently, users wishing to manage Btrfs filesystems programatically > have to shell out to btrfs-progs and parse the output. This isn't ideal. > The goal of libbtrfsutil is to provide a library version of as

Re: btrfs check: backref lost, mismatch with its hash -- can't repair

2018-01-28 Thread Qu Wenruo
On 2018年01月26日 23:15, ^m'e wrote: > On Fri, Jan 26, 2018 at 12:16 PM, Qu Wenruo wrote: >> Branch updated, problem in 1399 should be fixed. >> >> Seems the remaining problems are less and less now. >> >> Thanks, >> Qu >> > > Great! The fix worked, and repair goes

Re: degraded permanent mount option

2018-01-28 Thread Chris Murphy
On Sun, Jan 28, 2018 at 3:39 PM, Tomasz Pala wrote: > On Sun, Jan 28, 2018 at 13:02:08 -0700, Chris Murphy wrote: > >>> Tell me please, if you mount -o degraded btrfs - what would >>> BTRFS_IOC_DEVICES_READY return? >> >> case BTRFS_IOC_DEVICES_READY: >> ret =

Re: degraded permanent mount option

2018-01-28 Thread Tomasz Pala
On Sun, Jan 28, 2018 at 13:28:55 -0700, Chris Murphy wrote: >> Are you sure you really understand the problem? No mount happens because >> systemd waits for indication that it can mount and it never gets this >> indication. > > "not ready" is rather vague terminology but yes that's how systemd >

Re: degraded permanent mount option

2018-01-28 Thread Tomasz Pala
On Sun, Jan 28, 2018 at 13:02:08 -0700, Chris Murphy wrote: >> Tell me please, if you mount -o degraded btrfs - what would >> BTRFS_IOC_DEVICES_READY return? > > case BTRFS_IOC_DEVICES_READY: > ret = btrfs_scan_one_device(vol->name, FMODE_READ, > _fs_type, _devices); >

Re: degraded permanent mount option

2018-01-28 Thread Chris Murphy
On Sun, Jan 28, 2018 at 1:06 AM, Andrei Borzenkov wrote: > 27.01.2018 18:22, Duncan пишет: >> Adam Borowski posted on Sat, 27 Jan 2018 14:26:41 +0100 as excerpted: >> >>> On Sat, Jan 27, 2018 at 12:06:19PM +0100, Tomasz Pala wrote: On Sat, Jan 27, 2018 at 13:26:13 +0300,

Re: degraded permanent mount option

2018-01-28 Thread Chris Murphy
On Sat, Jan 27, 2018 at 5:39 PM, Tomasz Pala wrote: > On Sat, Jan 27, 2018 at 15:22:38 +, Duncan wrote: > >>> manages to mount degraded btrfs without problems. They just don't try >>> to outsmart the kernel. >> >> No kidding. >> >> All systemd has to do is leave the mount

[PATCH] btrfs: fix err_cast.cocci warnings

2018-01-28 Thread kbuild test robot
From: Fengguang Wu fs/btrfs/volumes.c:742:10-17: WARNING: ERR_CAST can be used with fs_devices Use ERR_CAST inlined function instead of ERR_PTR(PTR_ERR(...)) Generated by: scripts/coccinelle/api/err_cast.cocci Fixes: bf155c98d312 ("btrfs: get device pointer from

Re: degraded permanent mount option

2018-01-28 Thread Andrei Borzenkov
28.01.2018 18:57, Duncan пишет: > Andrei Borzenkov posted on Sun, 28 Jan 2018 11:06:06 +0300 as excerpted: > >> 27.01.2018 18:22, Duncan пишет: >>> Adam Borowski posted on Sat, 27 Jan 2018 14:26:41 +0100 as excerpted: >>> On Sat, Jan 27, 2018 at 12:06:19PM +0100, Tomasz Pala wrote: > On

Re: degraded permanent mount option

2018-01-28 Thread Duncan
Andrei Borzenkov posted on Sun, 28 Jan 2018 11:06:06 +0300 as excerpted: > 27.01.2018 18:22, Duncan пишет: >> Adam Borowski posted on Sat, 27 Jan 2018 14:26:41 +0100 as excerpted: >> >>> On Sat, Jan 27, 2018 at 12:06:19PM +0100, Tomasz Pala wrote: On Sat, Jan 27, 2018 at 13:26:13 +0300,

Re: degraded permanent mount option

2018-01-28 Thread Tomasz Pala
On Sun, Jan 28, 2018 at 01:00:16 +0100, Tomasz Pala wrote: > It can't mount degraded, because the "missing" device might go online a > few seconds ago. s/ago/after/ >> The central problem is the lack of a timer and time out. > > You got mdadm-last-resort@.timer/service above, if btrfs doesn't

Re: degraded permanent mount option

2018-01-28 Thread Tomasz Pala
On Sun, Jan 28, 2018 at 11:06:06 +0300, Andrei Borzenkov wrote: >> All systemd has to do is leave the mount alone that the kernel has >> already done, > > Are you sure you really understand the problem? No mount happens because > systemd waits for indication that it can mount and it never gets

Re: degraded permanent mount option

2018-01-28 Thread Andrei Borzenkov
27.01.2018 18:22, Duncan пишет: > Adam Borowski posted on Sat, 27 Jan 2018 14:26:41 +0100 as excerpted: > >> On Sat, Jan 27, 2018 at 12:06:19PM +0100, Tomasz Pala wrote: >>> On Sat, Jan 27, 2018 at 13:26:13 +0300, Andrei Borzenkov wrote: >>> > I just tested to boot with a single drive (raid1