summaryrefslogtreecommitdiff
path: root/btrfs-list.c
diff options
context:
space:
mode:
authorLi Zefan <lizf@cn.fujitsu.com>2010-12-15 03:33:33 +0000
committerChris Mason <chris.mason@oracle.com>2011-11-02 11:36:30 -0400
commitd2600786960bcfcecf9bbfd5bd055cf27212c524 (patch)
treee0cc8b53135534f0ad41fa4072c07101915aecc9 /btrfs-list.c
parentbab2c565cc0b1e8e12a47e27744456e8cd390a4c (diff)
Fix missing entries in listing of subvolumes
Stephane Chazelas <stephane.chazelas@gmail.com> writes: > I've got a btrfs FS with 84 subvolumes in it (some created with > "btrfs sub create", some with "btrfs sub snap" of the other > ones). There's no nesting of subvolumes at all (all direct children > of the root subvolume). > > The "btrfs subvolume list" is only showing 80 subvolumes. The 4 > missing ones (1 original volume, 3 snapshots) do exist on disk and > files in there have different st_devs from any other subvolume. > > I found > http://thread.gmane.org/gmane.comp.file-systems.btrfs/8123/focus=8208 > > which looks like the same issue, with Li Zefan saying he had a > fix, but I couldn't find any mention that it was actually fixed. Li Zefan <lizf@cn.fujitsu.com> replied: > After that, I posted a patch to fix btrfs-progs, which Chris aggreed > on: > > http://marc.info/?l=linux-btrfs&m=129238454714319&w=2 So this btrfs-progs patch should fix missing subvolumes in the output of "subvolume list": Signed-off-by: Li Zefan <lizf@cn.fujitsu.com> Signed-off-by: Hugo Mills <hugo@carfax.org.uk>
Diffstat (limited to 'btrfs-list.c')
-rw-r--r--btrfs-list.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/btrfs-list.c b/btrfs-list.c
index bd0df9e5..5751f1dd 100644
--- a/btrfs-list.c
+++ b/btrfs-list.c
@@ -636,7 +636,10 @@ static int __list_subvol_search(int fd, struct root_lookup *root_lookup)
/* this iteration is done, step forward one root for the next
* ioctl
*/
- if (sk->min_objectid < (u64)-1) {
+ if (sk->min_type < BTRFS_ROOT_BACKREF_KEY) {
+ sk->min_type = BTRFS_ROOT_BACKREF_KEY;
+ sk->min_offset = 0;
+ } else if (sk->min_objectid < (u64)-1) {
sk->min_objectid++;
sk->min_type = BTRFS_ROOT_BACKREF_KEY;
sk->min_offset = 0;