Receive directory not empty bug

2015-02-27 Thread Ames Cornish
Hi, btrfs is consistently refusing to receive send of certain directories. It fails with the message Directory not empty for an internal directory on the receiving side. Any ideas on what this might be or how to troubleshoot it? Here's an example: btrfs-progs v3.19-rc2

Re: Documenting MS_LAZYTIME

2015-02-27 Thread Theodore Ts'o
With Omar's suggestions, this looks great. Thanks!! - Ted -- To unsubscribe from this list: send the line unsubscribe linux-btrfs in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html

Re: [PATCH 2/2] btrfs-progs: Move (set/clear_)extent_buffer_uptodate() to extent_io.h.

2015-02-27 Thread David Sterba
On Tue, Jan 27, 2015 at 11:12:43AM +0800, Qu Wenruo wrote: Unlike kernel, these functions in userland just test/set/clear a member. So move them to header to avoid extra function call cost. Signed-off-by: Qu Wenruo quwen...@cn.fujitsu.com Applied, thanks. -- To unsubscribe from this list:

Re: [PATCH] btrfs-progs: per-thread, per-call pretty buffer

2015-02-27 Thread David Sterba
On Thu, Sep 04, 2014 at 12:45:45PM -0700, Zach Brown wrote: --- a/utils.h +++ b/utils.h @@ -71,13 +71,17 @@ int check_mounted_where(int fd, const char *file, char *where, int size, int btrfs_device_already_in_root(struct btrfs_root *root, int fd, int

Re: root subvol id is 0 or 5?

2015-02-27 Thread David Sterba
On Sun, Nov 30, 2014 at 07:12:46PM +0530, Shriramana Sharma wrote: On Sun, Nov 30, 2014 at 7:08 PM, Shriramana Sharma samj...@gmail.com wrote: So why 5 and not just 0 which seems a logical choice? On top of this, one needs to alias 0 to 5! Attached patch clarifying this in the

Re: Documenting MS_LAZYTIME

2015-02-27 Thread Darrick J. Wong
On Fri, Feb 27, 2015 at 09:01:10AM +0100, Michael Kerrisk (man-pages) wrote: On 02/27/2015 01:04 AM, Theodore Ts'o wrote: On Thu, Feb 26, 2015 at 02:36:33PM +0100, Michael Kerrisk (man-pages) wrote: The disadvantage of MS_STRICTATIME | MS_LAZYTIME is that in the case of a system

Re: [PATCH] btrfs-progs: Make csum tree rebuild works with extent tree rebuild.

2015-02-27 Thread David Sterba
On Mon, Jan 26, 2015 at 01:53:02PM +0800, Qu Wenruo wrote: Before this patch, csum tree rebuild will not work with extent tree rebuild, since extent tree rebuild will only build up basic block groups, but csum tree rebuild needs data extents to rebuild. So if one use btrfsck with

Re: [PATCH] Add more detailed package dependency information to INSTALL file

2015-02-27 Thread David Sterba
On Sat, May 31, 2014 at 03:24:46AM -0300, Augusto Mecking Caringi wrote: Signed-off-by: Augusto Mecking Caringi augustocari...@gmail.com Applied, thanks. -- To unsubscribe from this list: send the line unsubscribe linux-btrfs in the body of a message to majord...@vger.kernel.org More majordomo

[PATCH] btrfs-progs: use less memory for pretty_size_mode buffers

2015-02-27 Thread David Sterba
Anand reports that the static buffers used for pertty size strings cause a stack overflow on SPARC. Zach proposed to change the printf format to wrap the number and the suffix into a macro. This would require to change all callsites of pretty_size* and is not very convienient to write. This patch

[PATCH] btrfs-progs: convert: show progress by default

2015-02-27 Thread David Sterba
Agreed by several people, showing progress by default makes sense as conversion is a one-time and long running action. Signed-off-by: David Sterba dste...@suse.cz --- Documentation/btrfs-convert.txt | 2 +- btrfs-convert.c | 6 +++--- 2 files changed, 4 insertions(+), 4

Re: [PATCH 1/2] btrfs-progs:correct the return value

2015-02-27 Thread David Sterba
On Tue, Feb 10, 2015 at 06:23:13PM +0800, Dongsheng Yang wrote: From: Fan Chengniang fancn.f...@cn.fujitsu.com the return values 12 and 13 are not used spectially except as return value. No description and definition about them. so I change them to generic errno Signed-off-by: Fan

Re: Documenting MS_LAZYTIME

2015-02-27 Thread Michael Kerrisk (man-pages)
On 02/27/2015 01:04 AM, Theodore Ts'o wrote: On Thu, Feb 26, 2015 at 02:36:33PM +0100, Michael Kerrisk (man-pages) wrote: The disadvantage of MS_STRICTATIME | MS_LAZYTIME is that in the case of a system crash, the atime and mtime fields on disk might be out of date by at most 24

Re: Documenting MS_LAZYTIME

2015-02-27 Thread Omar Sandoval
On Fri, Feb 27, 2015 at 09:01:10AM +0100, Michael Kerrisk (man-pages) wrote: On 02/27/2015 01:04 AM, Theodore Ts'o wrote: On Thu, Feb 26, 2015 at 02:36:33PM +0100, Michael Kerrisk (man-pages) wrote: The disadvantage of MS_STRICTATIME | MS_LAZYTIME is that in the case of a system

[PATCH 5/7] btrfs: qgroup: clear STATUS_FLAG_ON in disabling quota.

2015-02-27 Thread Qu Wenruo
From: Dongsheng Yang yangds.f...@cn.fujitsu.com we forgot to clear STATUS_FLAG_ON in quota_disable(), it will cause a problem shown as below: # mount /dev/sdc /mnt # btrfs quota enable /mnt # btrfs quota disable /mnt # btrfs quota rescan /mnt quota rescan

[PATCH 1/7] btrfs: Check qgroup level in kernel qgroup assign.

2015-02-27 Thread Qu Wenruo
Although we have qgroup level check in btrfs-progs, it's not enough since other programe may still call ioctl directly not using btrfs-progs. For example, systemd. But it's btrfs-progs to be blame since we don't provide a full-function(like subvolume create things) btrfs library with enough

[PATCH 6/7] btrfs: quota: Automatically update related qgroups or mark INCONSISTENT flags when assigning/deleting a qgroup relations.

2015-02-27 Thread Qu Wenruo
Operation like qgroups assigning/deleting qgroup relations will mostly cause qgroup data inconsistent, since it needs to do the full rescan to determine whether shared extents are exclusive or still shared in parent qgroups. But there are some exceptions, like qgroup with only exclusive extents

[PATCH 0/7] Qgroup status flag fix and semi-automatic qgroup update on relationship assign

2015-02-27 Thread Qu Wenruo
This patchset will do the following bug fix mostly on incorrect flags. 1) INCONSISTENT flag never cleared bug 2) RESCANNING flag never cleared unless umount. Also add 2 qgroup level related checks: 1) Kernel check on qgroup assign to ensure dst's level is higher than src. 2) Restrict qgroup id

[PATCH 2/7] btrfs: Don't allow subvolid = (1 BTRFS_QGROUP_LEVEL_SHIFT) to be created

2015-02-27 Thread Qu Wenruo
Btrfs will create qgroup on subvolume creation if quota is enabled, but qgroup uses the high bits(currently 16 bits) as level, to build the inheritance. However it is fully possible a subvolume can be created with a subvolumeid larger than 1 BTRFS_QGROUP_LEVEL_SHIFT, so it will be considered as

[PATCH 4/7] btrfs: Update btrfs qgroup status item when rescan is done.

2015-02-27 Thread Qu Wenruo
Update qgroup status when rescan is done. Before this patch, status item is not updated on rescan finish, which causing the RESCAN and INCONSISTENT flags never cleared. Signed-off-by: Qu Wenruo quwen...@cn.fujitsu.com --- fs/btrfs/qgroup.c | 25 - 1 file changed, 24

[PATCH 3/7] btrfs: qgroup: Fix dead judgement on qgroup_rescan_leaf() return value.

2015-02-27 Thread Qu Wenruo
Old qgroup_rescan_leaf() comment indicates ret == 2 as complete and cleared INCONSISTENT flag. This is not true since it will never return 2, and inside it no codes will clear INCONSISTENT flag. The flag clearance is done in btrfs_qgroup_rescan_work(). This caused the bug that INCONSISTENT flag

[PATCH 7/7] btrfs: quota: Update quota tree after qgroup relationship change.

2015-02-27 Thread Qu Wenruo
Previous patch modified the in memory struct but it's not written in quota tree until next commit. So user will still get old data using btrfs qgroup show after assign/remove. This patch will call btrfs_run_qgroups in assign ioctl so it will be updated to in memory quota trees and user will get

Re: [PATCH] Generic test for file fsync after moving files across directories

2015-02-27 Thread Lukáš Czerner
On Thu, 26 Feb 2015, Filipe Manana wrote: Date: Thu, 26 Feb 2015 19:53:14 + From: Filipe Manana fdman...@suse.com To: fste...@vger.kernel.org Cc: linux-btrfs@vger.kernel.org, Filipe Manana fdman...@suse.com Subject: [PATCH] Generic test for file fsync after moving files across

[PATCH 0/7] btrfs-progs: qgroup related enhance.

2015-02-27 Thread Qu Wenruo
The patchset include the following bugfix: 1) Update qgroup status flags to keep consistent with kernel And the following enhancement: 1) debug-tree: Add human readable qgroup status flag. 2) qgroup show: Check status and print warning before if INCONSISTENT or RESCANNING(*1) 3) parse_qgroup:

[PATCH 7/7] btrfs-progs: Schedule quota rescan if qgroup assign caused inconsistence.

2015-02-27 Thread Qu Wenruo
NOTE: This patch needs to cooperate with kernel patches, which will fix a kernel bug that never clear INCONSISTENT bit and return 1 if quota assign makes qgroup data inconsistent. Some qgroup assign will cause qgroup data inconsistent, like remove a qgroup with shared extents from a parent

[PATCH 3/7] btrfs-progs: Move parse_qgroupid() to utils.c

2015-02-27 Thread Qu Wenruo
Signed-off-by: Qu Wenruo quwen...@cn.fujitsu.com --- qgroup.c | 28 qgroup.h | 1 - utils.c | 28 utils.h | 1 + 4 files changed, 29 insertions(+), 29 deletions(-) diff --git a/qgroup.c b/qgroup.c index 62f8777..7288365 100644 ---

[PATCH 2/7] btrfs-progs: Allow btrfs-debug-tree to print human readable qgroup status flag.

2015-02-27 Thread Qu Wenruo
Now btrfs-debug-tree can print qgroup status flag as ON|INCONSISTENT instead of 0x5. BTW, this patch helped us to find a bug that INCONSISTENT flag is never cleared in kernel. Signed-off-by: Qu Wenruo quwen...@cn.fujitsu.com --- print-tree.c | 30 +++--- 1 file changed,

[PATCH 4/7] btrfs-progs: Allow parse_qgroupid() to resolve subvolume path into qgroupid.

2015-02-27 Thread Qu Wenruo
Now parse_qgroupid() can resolve subvolume path into qgroupid. This is quite handy for handling level 0 qgroupid, and user don't need to resolve rootid by hand now. Signed-off-by: Qu Wenruo quwen...@cn.fujitsu.com --- utils.c | 46 ++ 1 file changed,

[PATCH 1/7] btrfs-progs: Update qgroup status flags and replace qgroup level/subvid calculation with inline function.

2015-02-27 Thread Qu Wenruo
Ctree.h of btrfs-progs contains wrong flags for btrfs_qgroup_status. Update it with the one in kernel. Also, introduce the inline function btrfs_qgroup_(level/subvid) to get the level/subvolid of qgroup, to replace the old open-coded bit operations. Signed-off-by: Qu Wenruo

[PATCH 6/7] btrfs-progs: Print warning message if qgroup data is inconsistent.

2015-02-27 Thread Qu Wenruo
Before this patch, qgroup show won't check btrfs qgroup status, so even the INCONSISTENT flags is set, user is not aware of it. This patch will include BTRFS_QGROUP_STATUS_ITEM in the search range and check the flag, if there is any flag meaning the inconsistence of qgroup data, info user. NOTE:

[PATCH 5/7] btrfs-progs: Add stack get/set functions for btrfs_qgroup_status_item.

2015-02-27 Thread Qu Wenruo
This provides the basis for later qgroup related changes. Signed-off-by: Qu Wenruo quwen...@cn.fujitsu.com --- ctree.h | 9 + 1 file changed, 9 insertions(+) diff --git a/ctree.h b/ctree.h index 1914a70..bf29e85 100644 --- a/ctree.h +++ b/ctree.h @@ -2079,6 +2079,15 @@

Re: Documenting MS_LAZYTIME

2015-02-27 Thread Michael Kerrisk (man-pages)
Hello Omar, On 02/27/2015 09:08 AM, Omar Sandoval wrote: On Fri, Feb 27, 2015 at 09:01:10AM +0100, Michael Kerrisk (man-pages) wrote: On 02/27/2015 01:04 AM, Theodore Ts'o wrote: On Thu, Feb 26, 2015 at 02:36:33PM +0100, Michael Kerrisk (man-pages) wrote: The disadvantage of

Re: [PATCH 4/7] btrfs-progs: Allow parse_qgroupid() to resolve subvolume path into qgroupid.

2015-02-27 Thread Qu Wenruo
Original Message Subject: Re: [PATCH 4/7] btrfs-progs: Allow parse_qgroupid() to resolve subvolume path into qgroupid. From: Wang Shilong wangshilong1...@gmail.com To: Qu Wenruo quwen...@cn.fujitsu.com Date: 2015年02月27日 16:41 Now parse_qgroupid() can resolve subvolume

Re: [PATCH] Generic test for file fsync after moving files across directories

2015-02-27 Thread Filipe David Manana
On Fri, Feb 27, 2015 at 9:40 AM, Lukáš Czerner lczer...@redhat.com wrote: On Thu, 26 Feb 2015, Filipe Manana wrote: Date: Thu, 26 Feb 2015 19:53:14 + From: Filipe Manana fdman...@suse.com To: fste...@vger.kernel.org Cc: linux-btrfs@vger.kernel.org, Filipe Manana fdman...@suse.com

Re: [PATCH] Generic test for file fsync after moving files across directories

2015-02-27 Thread Lukáš Czerner
On Fri, 27 Feb 2015, Filipe David Manana wrote: Date: Fri, 27 Feb 2015 10:54:43 + From: Filipe David Manana fdman...@gmail.com To: Lukáš Czerner lczer...@redhat.com Cc: Filipe Manana fdman...@suse.com, fste...@vger.kernel.org, linux-btrfs@vger.kernel.org linux-btrfs@vger.kernel.org

[PATCH v2] Generic test for file fsync after moving files across directories

2015-02-27 Thread Filipe Manana
Test file A fsync after moving one other unrelated file B between directories and fsyncing B's old parent directory before fsyncing the file A. Check that after a crash all the file A data we fsynced is available. This test is motivated by an issue discovered in btrfs which caused the file data