Re: [PATCH] fstests: generic test for fsync after adding xattr to a file

2015-06-18 Thread Filipe Manana
On Thu, Jun 18, 2015 at 4:48 AM, Eryu Guan wrote: > On Wed, Jun 17, 2015 at 12:52:47PM +0100, fdman...@kernel.org wrote: >> From: Filipe Manana >> >> This test is motivated by an issue found in btrfs. >> >> It tests that after syncing the filesystem, adding a xattr to a file, >> syncing the files

Re: RAID10 Balancing Request for Comments and Advices

2015-06-18 Thread Duncan
Vincent Olivier posted on Wed, 17 Jun 2015 09:46:50 -0400 as excerpted: >> On Jun 16, 2015, at 7:58 PM, Duncan <1i5t5.dun...@cox.net> wrote: >> >> Yes. GlobalReserve is for short-term btrfs-internal use, reserved for >> times when btrfs needs to (temporarily) allocate some space in ordered >> to

Unified output for btrfs? Fwd: Re: [Libguestfs] [PATCH] New API: btrfs_device_stats

2015-06-18 Thread Qu Wenruo
Hi all, My colleagues are working on adding btrfs support to libguestfs. But just like Pino's complain, even in v4.1-rc1 btrfs-progs we reworked some UI of mkfs, the output from other btrfs subcommands still have their own output format. Any idea to provide a unified output format for all b

Re: [PATCH] Btrfs: fix fsync data loss after append write

2015-06-18 Thread Liu Bo
On Wed, Jun 17, 2015 at 12:49:23PM +0100, fdman...@kernel.org wrote: > From: Filipe Manana > > If we do an append write to a file (which increases its inode's i_size) > that does not have the flag BTRFS_INODE_NEEDS_FULL_SYNC set in its inode, > and the previous transaction added a new hard link t

Re: btrfs partition converted from ext4 becomes read-only minutes after booting: WARNING: CPU: 2 PID: 2777 at ../fs/btrfs/super.c:260 __btrfs_abort_transaction+0x4b/0x120

2015-06-18 Thread Robert Munteanu
On Wed, Jun 17, 2015 at 8:46 PM, Marc MERLIN wrote: > On Fri, Jun 12, 2015 at 03:19:06PM +0300, Robert Munteanu wrote: >> Hi, > > Note to others: kernel 4.0.4 > > Reply to you: > I tried ext4 to btrfs once a year ago and it severely mangled my > filesystem. > I looked at it as a cool feature/hack

Re: btrfs partition converted from ext4 becomes read-only minutes after booting: WARNING: CPU: 2 PID: 2777 at ../fs/btrfs/super.c:260 __btrfs_abort_transaction+0x4b/0x120

2015-06-18 Thread Robert Munteanu
On Wed, Jun 17, 2015 at 9:48 PM, Jeff Mahoney wrote: > -BEGIN PGP SIGNED MESSAGE- > Hash: SHA1 > > On 6/12/15 8:19 AM, Robert Munteanu wrote: >> Hi, >> >> I have converted my root ext4 partition to btrfs. I used an USB >> stick to boot and used btrfs-convert. >> >> I also did a balance and

[PATCH v2] Btrfs: fix fsync xattr loss in the fast fsync path

2015-06-18 Thread fdmanana
From: Filipe Manana After commit 4f764e515361 ("Btrfs: remove deleted xattrs on fsync log replay"), we can end up in a situation where during log replay we end up deleting xattrs that were never deleted when their file was last fsynced. This happens in the fast fsync path (flag BTRFS_INODE_NEEDS

i_version vs iversion (Was: Re: [RFC PATCH v2 1/2] Btrfs: add noi_version option to disable MS_I_VERSION)

2015-06-18 Thread David Sterba
Moving the discussion to fsdevel. Summary: disabling MS_I_VERSION brings some speedups to btrfs, but the generic 'noiversion' option cannot be used to achieve that. It is processed before it reaches btrfs superblock callback, where MS_I_VERSION is forced. The proposed fix is to add btrfs-specific

Re: [PATCH RFC] btrfs: csum: Introduce partial csum for tree block.

2015-06-18 Thread Facebook
On Wed, Jun 17, 2015 at 9:34 PM, Qu Wenruo wrote: Ping? New new comments? As our block sizes get bigger, it makes sense to think about more fine grained checksums. We're using crcs for: 1) memory corruption on the way down to the storage. We could be very small (bitflips) or smaller

Re: [PATCH] check: check so offset is not bigger then the leaf

2015-06-18 Thread David Sterba
On Thu, Jun 18, 2015 at 01:59:13AM +0200, Robert Marklund wrote: > This could crash before because of dangerous dangling > offset of pointer. That's right, this can happen. There are more btrfs_item_ptr that would be good to validate that way, namely in the checker as it's most likely to see corru

Re: [PATCH RFC] btrfs: csum: Introduce partial csum for tree block.

2015-06-18 Thread David Sterba
On Thu, Jun 18, 2015 at 11:57:46AM -0400, Facebook wrote: > > New new comments? > > As our block sizes get bigger, it makes sense to think about more fine > grained checksums. We're using crcs for: > > 1) memory corruption on the way down to the storage. We could be very > small (bitflips) or

Re: [PATCH] check: check so offset is not bigger then the leaf

2015-06-18 Thread Josef Bacik
On 06/18/2015 09:44 AM, David Sterba wrote: On Thu, Jun 18, 2015 at 01:59:13AM +0200, Robert Marklund wrote: This could crash before because of dangerous dangling offset of pointer. That's right, this can happen. There are more btrfs_item_ptr that would be good to validate that way, namely in

Re: btrfs-progs 4.1-rc1: btrfstune -u reporting incorrect current fsid?

2015-06-18 Thread David Sterba
On Wed, Jun 17, 2015 at 10:21:45PM +0100, Mike Fleetwood wrote: > It also upper cases the UUID where as btrfs fi sh and blkid don't. Ok, I'll switch that to lowercase so it's consistent with the rest. > I've done a quick test on changing the UUID of a btrfs. It worked, but > btrfstune -u didn't

Re: [PATCH 5/5] Btrfs: incremental send, fix rmdir not send utimes

2015-06-18 Thread Filipe David Manana
On Thu, Jun 18, 2015 at 4:21 AM, Robbie Ko wrote: > Hi Filipe, > > I've found that the following case is the main cause of such error > and it's fs tree is shown via btrfs-debug-tress as below. > > file tree key (459 ROOT_ITEM 20487) > node 132988928 level 1 items 3 free 490 generation 20487 owner

[PATCH 0/2] btrfs: two more dedupe fixes

2015-06-18 Thread Mark Fasheh
Hi Chris, The following fixes are based on top of my patch titled "btrfs: Handle unaligned length in extent_same" which you have in your 'integration-4.2' branch: https://git.kernel.org/cgit/linux/kernel/git/mason/linux-btrfs.git/commit/?id=e1d227a42ea2b4664f94212bd1106b9a3413ffb8 The first p

[PATCH 1/2] btrfs: pass unaligned length to btrfs_cmp_data()

2015-06-18 Thread Mark Fasheh
In the case that we dedupe the tail of a file, we might expand the dedupe len out to the end of our last block. We don't want to compare data past i_size however, so pass the original length to btrfs_cmp_data(). Signed-off-by: Mark Fasheh --- fs/btrfs/ioctl.c | 3 ++- 1 file changed, 2 insertion

[PATCH 2/2] btrfs: fix deadlock with extent-same and readpage

2015-06-18 Thread Mark Fasheh
->readpage() does page_lock() before extent_lock(), we do the opposite in extent-same. We want to reverse the order in btrfs_extent_same() but it's not quite straightforward since the page locks are taken inside btrfs_cmp_data(). So I split btrfs_cmp_data() into 3 parts with a small context struc

[PATCH] btrfs-progs: alias btrfs device delete to btrfs device remove

2015-06-18 Thread Omar Sandoval
There's an awkward asymmetry between btrfs device add and btrfs device delete. Resolve this by aliasing delete to remove. Signed-off-by: Omar Sandoval --- Documentation/btrfs-device.asciidoc | 5 - cmds-device.c | 33 +++-- 2 files changed,

Corrupted btrfs partition (converted from ext4) after balance

2015-06-18 Thread Vianney Stroebel
One of my btrfs partition seems to have been corrupted. Since I've tried to balance it, I can only mount it read-only. I have been able to use it read-only without problem so far so the data seems safe. When I remove the "ro" option, the "mount" command hangs and some programs do not function

Re: [PATCH RFC] btrfs: csum: Introduce partial csum for tree block.

2015-06-18 Thread Qu Wenruo
David Sterba wrote on 2015/06/18 19:06 +0200: On Thu, Jun 18, 2015 at 11:57:46AM -0400, Facebook wrote: New new comments? As our block sizes get bigger, it makes sense to think about more fine grained checksums. We're using crcs for: 1) memory corruption on the way down to the storage. We

Re: btrfs-progs 4.1-rc1: btrfstune -u reporting incorrect current fsid?

2015-06-18 Thread Qu Wenruo
David Sterba wrote on 2015/06/18 19:33 +0200: On Wed, Jun 17, 2015 at 10:21:45PM +0100, Mike Fleetwood wrote: It also upper cases the UUID where as btrfs fi sh and blkid don't. Ok, I'll switch that to lowercase so it's consistent with the rest. I've done a quick test on changing the UUID o

[PATCH] Btrfs: add autodefrag inode flag

2015-06-18 Thread Omar Sandoval
In some cases, we may not want to enable automatic defragmentation for the whole filesystem with the "autodefrag" mount option but we still want to defragment specific files or directories. Add an inode flag which allows us to do specify that. Signed-off-by: Omar Sandoval --- fs/btrfs/ctree.h

[PATCH 1/2] btrfs-progs: Add nbytes output for print-tree and reformat inode output

2015-06-18 Thread Qu Wenruo
The original implement doesn't output nbytes in btrfs_inode. Add the output and since the output is too long, reformat it to multi lines. This is very handy to debug related bugs. Signed-off-by: Qu Wenruo --- print-tree.c | 5 - 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/p

[PATCH 2/2] btrfs-progs: Add repair function for I_ERR_FILE_WRONG_NBYTES.

2015-06-18 Thread Qu Wenruo
Some unknown kernel bug makes inode nbytes modification out of sync with file extent update. But it's quite easy to fix in btrfs-progs anyway. So just fix it by adding a new function repair_inode_nbytes by using the found_size in inode_record. Reported-by: Christian Reported-by: Chris Murphy S

Re: [RFC PATCH V11 01/21] Btrfs: subpagesize-blocksize: Fix whole page read.

2015-06-18 Thread Liu Bo
On Mon, Jun 01, 2015 at 08:52:36PM +0530, Chandan Rajendra wrote: > For the subpagesize-blocksize scenario, a page can contain multiple > blocks. In such cases, this patch handles reading data from files. > > To track the status of individual blocks of a page, this patch makes use of a > bitmap po

Re: [PATCH v9 9/9] btrfs: Use sb_want_write() to protect sysfs feature change.

2015-06-18 Thread Qu Wenruo
OK, it's 4.2 merge windows now... But still no new comments? Thanks, Qu Qu Wenruo wrote on 2015/05/15 14:47 +0800: Ping. Any comments? Other v7 patchset is reviewed by David. But I didn't find it in 4.1 merge windows. Is something wrong or we are waiting for the vfs patch merged first? Than

Re: [PATCH RFC v7 1/9] vfs: Add sb_want_write() function to grant write access to sb without the struct file/vfsmount.

2015-06-18 Thread Qu Wenruo
Any new comments? BTW, who is responsible to merge the vfs change patch? Should btrfs maintainers to merge it or vfs maintainer? Thanks, Qu Qu Wenruo wrote on 2015/02/06 13:45 +0800: There are sysfs interfaces in some fs, only btrfs yet, which will modify on-disk data. Unlike normal file opera