[PATCH] btrfs: Always check nocow for quota enabled case to make sure we won't reserve unnecessary data space

2018-08-14 Thread Qu Wenruo
Commit c6887cd11149 ("Btrfs: don't do nocow check unless we have to") makes nocow check less frequent to improve performance. However for quota enabled case, such optimization could lead to extra unnecessary data reservation, which results failure for test case like btrfs/153 in fstests. Fix it b

Re: List of known BTRFS Raid 5/6 Bugs?

2018-08-14 Thread Zygo Blaxell
On Tue, Aug 14, 2018 at 09:32:51AM +0200, Menion wrote: > Hi > Well, I think it is worth to give more details on the array. > the array is built with 5x8TB HDD in an esternal USB3.0 to SATAIII enclosure > The enclosure is a cheap JMicron based chinese stuff (from Orico). > There is one USB3.0 link

Re: [PATCH] Btrfs: remove duplicated btrfs_release_path in btrfs_unlink_subvol

2018-08-14 Thread Liu Bo
On Tue, Aug 14, 2018 at 12:46:00PM +0200, David Sterba wrote: > On Tue, Aug 14, 2018 at 10:47:09AM +0800, Liu Bo wrote: > > The btrfs_release_path() is just useless as path is only used in error > > handling. > > Where is it duplicated? And I don't think it's useless, while the > changelog does n

Re: How to ensure that a snapshot is not corrupted?

2018-08-14 Thread Hans van Kranenburg
On 08/10/2018 12:07 PM, Cerem Cem ASLAN wrote: > Original question is here: https://superuser.com/questions/1347843 > > How can we sure that a readonly snapshot is not corrupted due to a disk > failure? > > Is the only way calculating the checksums one on another and store it > for further exami

Re: trouble mounting btrfs filesystem....

2018-08-14 Thread Hans van Kranenburg
On 08/14/2018 07:09 PM, Andrei Borzenkov wrote: > 14.08.2018 18:16, Hans van Kranenburg пишет: >> On 08/14/2018 03:00 PM, Dmitrii Tcvetkov wrote: Scott E. Blomquist writes: > Hi All, > > [...] >>> >>> I'm not a dev, just user. >>> btrfs-zero-log is for very specific case[1],

Re: [PATCH] Btrfs: correctly caculate item size used when item key collision happends

2018-08-14 Thread Hans van Kranenburg
On 08/14/2018 11:05 AM, ethanwu wrote: > Item key collision is allowed for some item types, like dir item and > inode refs, but the overall item size is limited by the leafsize. > > item size(ins_len) passed from btrfs_insert_empty_items to > btrfs_search_slot already contains size of btrfs_item.

Re: [PATCH 2/2] Btrfs: sync log after logging new name

2018-08-14 Thread David Sterba
On Tue, Aug 14, 2018 at 12:04:05PM -0700, Omar Sandoval wrote: > On Mon, Jun 18, 2018 at 01:06:16PM +0200, David Sterba wrote: > > On Fri, Jun 15, 2018 at 05:19:07PM +0100, Filipe Manana wrote: > > > On Fri, Jun 15, 2018 at 4:54 PM, David Sterba wrote: > > > > On Mon, Jun 11, 2018 at 07:24:28PM +0

Re: trouble mounting btrfs filesystem....

2018-08-14 Thread Roman Mamedov
On Tue, 14 Aug 2018 16:41:11 +0300 Dmitrii Tcvetkov wrote: > If usebackuproot doesn't help then filesystem is beyond repair and you > should try to refresh your backups with "btrfs restore" and restore from > them[1]. > > [1] > https://btrfs.wiki.kernel.org/index.php/FAQ#How_do_I_recover_from_

Re: [PATCH 2/2] Btrfs: sync log after logging new name

2018-08-14 Thread Omar Sandoval
On Mon, Jun 18, 2018 at 01:06:16PM +0200, David Sterba wrote: > On Fri, Jun 15, 2018 at 05:19:07PM +0100, Filipe Manana wrote: > > On Fri, Jun 15, 2018 at 4:54 PM, David Sterba wrote: > > > On Mon, Jun 11, 2018 at 07:24:28PM +0100, fdman...@kernel.org wrote: > > >> From: Filipe Manana > > >> Fixe

[PATCH] Btrfs: clean up scrub is_dev_replace parameter

2018-08-14 Thread Omar Sandoval
From: Omar Sandoval struct scrub_ctx has an ->is_dev_replace member, so there's no point in passing around is_dev_replace where sctx is available. Signed-off-by: Omar Sandoval --- fs/btrfs/scrub.c | 23 +-- 1 file changed, 9 insertions(+), 14 deletions(-) diff --git a/fs/b

Re: trouble mounting btrfs filesystem....

2018-08-14 Thread Andrei Borzenkov
14.08.2018 18:16, Hans van Kranenburg пишет: > On 08/14/2018 03:00 PM, Dmitrii Tcvetkov wrote: >>> Scott E. Blomquist writes: >>> > Hi All, >>> > >>> > [...] >> >> I'm not a dev, just user. >> btrfs-zero-log is for very specific case[1], not for transid errors. >> Transid errors mean that some

Re: trouble mounting btrfs filesystem....

2018-08-14 Thread Hans van Kranenburg
On 08/14/2018 03:00 PM, Dmitrii Tcvetkov wrote: >> Scott E. Blomquist writes: >> > Hi All, >> > >> > [...] > > I'm not a dev, just user. > btrfs-zero-log is for very specific case[1], not for transid errors. > Transid errors mean that some metadata writes are missing, if > they prevent you fro

Re: trouble mounting btrfs filesystem....

2018-08-14 Thread Hans van Kranenburg
On 08/12/2018 09:19 PM, Scott E. Blomquist wrote: > > Hi All, > > Early this morning there was a power glitch that affected our system. > > The second enclosure went offline but the file system stayed up for a > bit before rebooting and recovering the 2 missing arrays sdb1 and > sdc1. > > When

Re: trouble mounting btrfs filesystem....

2018-08-14 Thread Scott E. Blomquist
Dmitrii Tcvetkov writes: > On Tue, 14 Aug 2018 09:31:56 -0400 > "Scott E. Blomquist" wrote: > > > Dmitrii Tcvetkov writes: > > > > Scott E. Blomquist writes: > > > > > Hi All, > > > > > > > > > > Early this morning there was a power glitch that affected our > > > > > system

Re: trouble mounting btrfs filesystem....

2018-08-14 Thread Dmitrii Tcvetkov
On Tue, 14 Aug 2018 09:31:56 -0400 "Scott E. Blomquist" wrote: > Dmitrii Tcvetkov writes: > > > Scott E. Blomquist writes: > > > > Hi All, > > > > > > > > Early this morning there was a power glitch that affected our > > > > system. > > > > > > > > The second enclosure went offli

Re: trouble mounting btrfs filesystem....

2018-08-14 Thread Scott E. Blomquist
Dmitrii Tcvetkov writes: > > Scott E. Blomquist writes: > > > Hi All, > > > > > > Early this morning there was a power glitch that affected our > > > system. > > > > > > The second enclosure went offline but the file system stayed up > > > for a bit before rebooting and recoverin

Re: [RFC PATCH] btrfs: Remove 'objectid' member from struct btrfs_root

2018-08-14 Thread Qu Wenruo
On 2018/8/14 上午1:37, David Sterba wrote: > On Mon, Aug 06, 2018 at 02:17:54PM +0800, Qu Wenruo wrote: >>> - u64 objectid; >> >> Off topic crazy idea here. >> >> I think it is a little crazy, but it should save a lot of objectid >> related modification: >> >> diff --git a/fs/btrfs/ctree.h b/fs/b

Re: trouble mounting btrfs filesystem....

2018-08-14 Thread Dmitrii Tcvetkov
> Scott E. Blomquist writes: > > Hi All, > > > > Early this morning there was a power glitch that affected our > > system. > > > > The second enclosure went offline but the file system stayed up > > for a bit before rebooting and recovering the 2 missing arrays > > sdb1 and sdc1. > > >

Re: trouble mounting btrfs filesystem....

2018-08-14 Thread Scott E. Blomquist
Hi All, Is there any more info needed here? I can restore from backup if needed but that will take a bit of time. Checking around it looks like I could try... btrfs-zero-log /dev/sda1 Or maybe .. btrfsck --repair /dev/sda1 I am just not sure here and would prefer to do the right thi

Re: [PATCH] Btrfs: do not pass write_lock_level when processing leaf

2018-08-14 Thread David Sterba
On Tue, Aug 14, 2018 at 10:46:53AM +0800, Liu Bo wrote: > As we're going to return, it doesn't make sense to get a new > write_lock_level from unlock_up. > > Signed-off-by: Liu Bo Reviewed-by: David Sterba

Re: [PATCH] Btrfs: remove duplicated btrfs_release_path in btrfs_unlink_subvol

2018-08-14 Thread David Sterba
On Tue, Aug 14, 2018 at 10:47:09AM +0800, Liu Bo wrote: > The btrfs_release_path() is just useless as path is only used in error > handling. Where is it duplicated? And I don't think it's useless, while the changelog does not explain why and it's not obvious from the context. If the path is locke

[PATCH] Btrfs: correctly caculate item size used when item key collision happends

2018-08-14 Thread ethanwu
Item key collision is allowed for some item types, like dir item and inode refs, but the overall item size is limited by the leafsize. item size(ins_len) passed from btrfs_insert_empty_items to btrfs_search_slot already contains size of btrfs_item. When btrfs_search_slot reaches leaf, we'll see i

Re: List of known BTRFS Raid 5/6 Bugs?

2018-08-14 Thread Menion
Hi Well, I think it is worth to give more details on the array. the array is built with 5x8TB HDD in an esternal USB3.0 to SATAIII enclosure The enclosure is a cheap JMicron based chinese stuff (from Orico). There is one USB3.0 link for all the 5 HDD with a SATAIII 3.0Gb multiplexer behind it. So y