[PATCH] Btrfs: handle bio_add_page failure gracefully in scrub

2011-11-11 Thread Arne Jansen
Currently scrub fails with ENOMEM when bio_add_page fails. Unfortunately
dm based targets accept only one page per bio, thus making scrub always
fails. This patch just submits the current bio when an error is encountered
and starts a new one.

Signed-off-by: Arne Jansen sensi...@gmx.net
---
 fs/btrfs/scrub.c |   64 -
 1 files changed, 29 insertions(+), 35 deletions(-)

diff --git a/fs/btrfs/scrub.c b/fs/btrfs/scrub.c
index ed11d38..f4190f2 100644
--- a/fs/btrfs/scrub.c
+++ b/fs/btrfs/scrub.c
@@ -944,50 +944,18 @@ static int scrub_checksum_super(struct scrub_bio *sbio, 
void *buffer)
 static int scrub_submit(struct scrub_dev *sdev)
 {
struct scrub_bio *sbio;
-   struct bio *bio;
-   int i;
 
if (sdev-curr == -1)
return 0;
 
sbio = sdev-bios[sdev-curr];
-
-   bio = bio_alloc(GFP_NOFS, sbio-count);
-   if (!bio)
-   goto nomem;
-
-   bio-bi_private = sbio;
-   bio-bi_end_io = scrub_bio_end_io;
-   bio-bi_bdev = sdev-dev-bdev;
-   bio-bi_sector = sbio-physical  9;
-
-   for (i = 0; i  sbio-count; ++i) {
-   struct page *page;
-   int ret;
-
-   page = alloc_page(GFP_NOFS);
-   if (!page)
-   goto nomem;
-
-   ret = bio_add_page(bio, page, PAGE_SIZE, 0);
-   if (!ret) {
-   __free_page(page);
-   goto nomem;
-   }
-   }
-
sbio-err = 0;
sdev-curr = -1;
atomic_inc(sdev-in_flight);
 
-   submit_bio(READ, bio);
+   submit_bio(READ, sbio-bio);
 
return 0;
-
-nomem:
-   scrub_free_bio(bio);
-
-   return -ENOMEM;
 }
 
 static int scrub_page(struct scrub_dev *sdev, u64 logical, u64 len,
@@ -995,6 +963,8 @@ static int scrub_page(struct scrub_dev *sdev, u64 logical, 
u64 len,
  u8 *csum, int force)
 {
struct scrub_bio *sbio;
+   struct page *page;
+   int ret;
 
 again:
/*
@@ -1015,12 +985,22 @@ again:
}
sbio = sdev-bios[sdev-curr];
if (sbio-count == 0) {
+   struct bio *bio;
+
sbio-physical = physical;
sbio-logical = logical;
+   bio = bio_alloc(GFP_NOFS, SCRUB_PAGES_PER_BIO);
+   if (!bio)
+   return -ENOMEM;
+
+   bio-bi_private = sbio;
+   bio-bi_end_io = scrub_bio_end_io;
+   bio-bi_bdev = sdev-dev-bdev;
+   bio-bi_sector = sbio-physical  9;
+   sbio-err = 0;
+   sbio-bio = bio;
} else if (sbio-physical + sbio-count * PAGE_SIZE != physical ||
   sbio-logical + sbio-count * PAGE_SIZE != logical) {
-   int ret;
-
ret = scrub_submit(sdev);
if (ret)
return ret;
@@ -1030,6 +1010,20 @@ again:
sbio-spag[sbio-count].generation = gen;
sbio-spag[sbio-count].have_csum = 0;
sbio-spag[sbio-count].mirror_num = mirror_num;
+
+   page = alloc_page(GFP_NOFS);
+   if (!page)
+   return -ENOMEM;
+
+   ret = bio_add_page(sbio-bio, page, PAGE_SIZE, 0);
+   if (!ret) {
+   __free_page(page);
+   ret = scrub_submit(sdev);
+   if (ret)
+   return ret;
+   goto again;
+   }
+
if (csum) {
sbio-spag[sbio-count].have_csum = 1;
memcpy(sbio-spag[sbio-count].csum, csum, sdev-csum_size);
-- 
1.7.3.4

--
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] Btrfs: fix our reservations for updating an inode when completing io V3

2011-11-11 Thread David Sterba
On Thu, Nov 10, 2011 at 05:57:07PM -0500, Josef Bacik wrote:
 --- a/fs/btrfs/ctree.h
 +++ b/fs/btrfs/ctree.h
 @@ -2699,8 +2699,8 @@ struct extent_map *btrfs_get_extent(struct inode 
 *inode, struct page *page,
   size_t pg_offset, u64 start, u64 end,
   int create);
  int btrfs_update_inode(struct btrfs_trans_handle *trans,
 -   struct btrfs_root *root,
 -   struct inode *inode);
 +struct btrfs_root *root, struct inode *inode,
 +int fallback);

Can you please add a helper __btrfs_update_inode which takes the
argument, leave btrfs_update_inode as is and add
btrfs_update_inode_fallback for the '1' case?

So you don't change every callsite of btrfs_update_inode and just those 4
which need _fallback variant (the rest is 29, quite a lot).


david
--
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] Btrfs: fix our reservations for updating an inode when completing io V3

2011-11-11 Thread Chris Mason
On Fri, Nov 11, 2011 at 01:28:36PM +0100, David Sterba wrote:
 On Thu, Nov 10, 2011 at 05:57:07PM -0500, Josef Bacik wrote:
  --- a/fs/btrfs/ctree.h
  +++ b/fs/btrfs/ctree.h
  @@ -2699,8 +2699,8 @@ struct extent_map *btrfs_get_extent(struct inode 
  *inode, struct page *page,
  size_t pg_offset, u64 start, u64 end,
  int create);
   int btrfs_update_inode(struct btrfs_trans_handle *trans,
  - struct btrfs_root *root,
  - struct inode *inode);
  +  struct btrfs_root *root, struct inode *inode,
  +  int fallback);
 
 Can you please add a helper __btrfs_update_inode which takes the
 argument, leave btrfs_update_inode as is and add
 btrfs_update_inode_fallback for the '1' case?
 
 So you don't change every callsite of btrfs_update_inode and just those 4
 which need _fallback variant (the rest is 29, quite a lot).

I reworked this last night since I already have v2.  See my for-linus
branch.

-chris
--
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: How to remount btrfs without compression?

2011-11-11 Thread dima

On 11/10/2011 11:23 AM, dima wrote:

On 11/10/2011 09:11 AM, David Sterba wrote:

On Wed, Nov 09, 2011 at 10:01:13AM +0900, dima wrote:

Just for the record - I could find a solution thanks to the btrfs wiki
being online again. In Gotchas it says

mount -o nodatacow also disables compression

and indeed it does. Remounting with this option and re-saving the file
makes it uncompressed. However, I could not find how to remount the
filesystem afterwards without nodatacow.


I saw this mentioned on irc today (that nodatacow diasables
compression). There is a way how to turn off compression on a file --
with help of the NOCOW _file_ attribute, ie. you don't have to remount.

* create the file, compression enabled
* set NOCOW (with the attached single-purpose nocow.c utility)
* btrfs fi defrag the_file

Make sure you have enough free space for the uncompressed file size. You
can compare the extent layout before and after the defrag with
filefrag -v .



Hello David,

Thank you, I will try it out tonight. Is there any way to see if nocow
attribute was set on a particular file, and is there any way to unset it?



Hi David
I tried the nocow utility. It worked.
First I made sure to re-save the syslinux.cfg file while btrfs was 
mounted with lzo to ensure that it is compressed, then I set the NOCOW 
flag with your utility. Then I checked fragmentation of the file and 
since it was a small one it was not fragmented. So when I ran btrfs fi 
defrag syslinux.cfg it did not have any effect and file was not 
uncompressed. Then I simply re-saved the file and it got uncompressed 
fine since bootloader could read it on reboot.


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 info at  http://vger.kernel.org/majordomo-info.html


[PATCH] btrfs: rename the option to nospace_cache

2011-11-11 Thread David Sterba
Rename no_space_cache option to nospace_cache to be more consistent with
the rest, where the simple prefix 'no' is used to negate an option.

The option has been introduced during the -rc1 cycle and there are has not been
widely used, so it's safe.

Signed-off-by: David Sterba dste...@suse.cz
---

 fs/btrfs/super.c |4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/fs/btrfs/super.c b/fs/btrfs/super.c
index 629281c..8bd9d6d 100644
--- a/fs/btrfs/super.c
+++ b/fs/btrfs/super.c
@@ -197,7 +197,7 @@ static match_table_t tokens = {
{Opt_subvolrootid, subvolrootid=%d},
{Opt_defrag, autodefrag},
{Opt_inode_cache, inode_cache},
-   {Opt_no_space_cache, no_space_cache},
+   {Opt_no_space_cache, nospace_cache},
{Opt_recovery, recovery},
{Opt_err, NULL},
 };
@@ -711,7 +711,7 @@ static int btrfs_show_options(struct seq_file *seq, struct 
vfsmount *vfs)
if (btrfs_test_opt(root, SPACE_CACHE))
seq_puts(seq, ,space_cache);
else
-   seq_puts(seq, ,no_space_cache);
+   seq_puts(seq, ,nospace_cache);
if (btrfs_test_opt(root, CLEAR_CACHE))
seq_puts(seq, ,clear_cache);
if (btrfs_test_opt(root, USER_SUBVOL_RM_ALLOWED))
-- 
1.7.6

--
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] btrfs: rename the option to nospace_cache

2011-11-11 Thread Roman Mamedov
On Fri, 11 Nov 2011 16:41:55 +0100
David Sterba dste...@suse.cz wrote:

 Rename no_space_cache option to nospace_cache to be more consistent with
 the rest, where the simple prefix 'no' is used to negate an option.
 
 The option has been introduced during the -rc1 cycle and there are has not 
 been
 widely used, so it's safe.

In my opinion as soon as you start using underscores to split words in an 
identifier, you have to use them to separate all the words, not just some of 
them. So it should be either no_space_cache, or nospacecache; the version 
proposed here looks puzzling and wrong (does this enable a 'cache for 
nospace'?).

Also, space_cache=off would be vastly better IMO. Consistent with 
compress=blah/compress-force=blah, too. And in the same manner theoretically 
there could be several algorithms for space caching in future, switchable by 
this same option (space_cache=whatever).

 
 Signed-off-by: David Sterba dste...@suse.cz
 ---
 
  fs/btrfs/super.c |4 ++--
  1 files changed, 2 insertions(+), 2 deletions(-)
 
 diff --git a/fs/btrfs/super.c b/fs/btrfs/super.c
 index 629281c..8bd9d6d 100644
 --- a/fs/btrfs/super.c
 +++ b/fs/btrfs/super.c
 @@ -197,7 +197,7 @@ static match_table_t tokens = {
   {Opt_subvolrootid, subvolrootid=%d},
   {Opt_defrag, autodefrag},
   {Opt_inode_cache, inode_cache},
 - {Opt_no_space_cache, no_space_cache},
 + {Opt_no_space_cache, nospace_cache},
   {Opt_recovery, recovery},
   {Opt_err, NULL},
  };
 @@ -711,7 +711,7 @@ static int btrfs_show_options(struct seq_file *seq, 
 struct vfsmount *vfs)
   if (btrfs_test_opt(root, SPACE_CACHE))
   seq_puts(seq, ,space_cache);
   else
 - seq_puts(seq, ,no_space_cache);
 + seq_puts(seq, ,nospace_cache);
   if (btrfs_test_opt(root, CLEAR_CACHE))
   seq_puts(seq, ,clear_cache);
   if (btrfs_test_opt(root, USER_SUBVOL_RM_ALLOWED))


-- 
With respect,
Roman

~~~
Stallman had a printer,
with code he could not see.
So he began to tinker,
and set the software free.


signature.asc
Description: PGP signature


Re: Stupid newb tricks: making a subvolume of root.

2011-11-11 Thread Ken D'Ambrosio
On Thu, 10 Nov 2011 14:59:44 + Hugo Mills h...@carfax.org.uk wrote

Alternatively, if you want the top level to be simply a container
 for subvolumes (and to use a default subvolume to mount / ), then you
 could do the switch-over by making a snapshot of your current /,
 remounting with the snapshot as / (possibly using btrfs sub
 set-default), and then mounting subvolid=0 on /media/btrfs-management
 to delete the old contents of /

So, I did this.  I think correctly:
mkdir /tmp/foo
mount /dev/sda1 /tmp/foo -o subvolid=0
And lo!  I did an ls, and everything was there.  And then the kernel panic'd. 
I rebooted, re-mounted, and it was there again.  And then the kernel panic'd. 
Last time, I didn't even try an ls -- I just did a btrfs subvol list
/tmp/foo, and yet another panic.  This is running 3.2rc1 (with tools built off
 the git repository on kernel.org, if that makes any difference).

My system is, technically, working.  Any suggestions on how to get rid of my
old root?

Thanks...

-Ken





--
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: Stupid newb tricks: making a subvolume of root.

2011-11-11 Thread Hugo Mills
On Fri, Nov 11, 2011 at 02:06:42PM -0500, Ken D'Ambrosio wrote:
 On Thu, 10 Nov 2011 14:59:44 + Hugo Mills h...@carfax.org.uk wrote
 
 Alternatively, if you want the top level to be simply a container
  for subvolumes (and to use a default subvolume to mount / ), then you
  could do the switch-over by making a snapshot of your current /,
  remounting with the snapshot as / (possibly using btrfs sub
  set-default), and then mounting subvolid=0 on /media/btrfs-management
  to delete the old contents of /
 
 So, I did this.  I think correctly:
 mkdir /tmp/foo
 mount /dev/sda1 /tmp/foo -o subvolid=0
 And lo!  I did an ls, and everything was there.  And then the kernel panic'd. 
 I rebooted, re-mounted, and it was there again.  And then the kernel panic'd. 

   I'm starting to see a pattern forming here. ;)

 Last time, I didn't even try an ls -- I just did a btrfs subvol list
 /tmp/foo, and yet another panic.  This is running 3.2rc1 (with tools built 
 off
  the git repository on kernel.org, if that makes any difference).

   The tools shouldn't make a difference to this. (Anything that makes
the kernel panic is a bug in the kernel, not in the thing that
triggers it).

 My system is, technically, working.  Any suggestions on how to get rid of my
 old root?

   I'd suggest reporting (on this mailing list) the panic message(s)
you got, and how you got to them. I know there's been quite a few
additional patches worked on since Chris pushed out the stack for
-rc1, so it's quite plausible that your particular problem has already
been fixed in someone's tree.

   The other thing you could try is dropping back to 3.1 and see if
that's stable for you with this.

   Hugo.

-- 
=== Hugo Mills: hugo@... carfax.org.uk | darksatanic.net | lug.org.uk ===
  PGP key: 515C238D from wwwkeys.eu.pgp.net or http://www.carfax.org.uk
   --- Quidquid latine dictum sit,  altum videtur. ---   


signature.asc
Description: Digital signature


[PATCH] Btrfs: add allocator tracepoints

2011-11-11 Thread Josef Bacik
I used these tracepoints when figuring out what the cluster stuff was doing, so
add them to mainline in case we need to profile this stuff again.  Thanks,

Signed-off-by: Josef Bacik jo...@redhat.com
---
 fs/btrfs/extent-tree.c   |9 ++
 fs/btrfs/free-space-cache.c  |   11 +++-
 include/trace/events/btrfs.h |  173 ++
 3 files changed, 192 insertions(+), 1 deletions(-)

diff --git a/fs/btrfs/extent-tree.c b/fs/btrfs/extent-tree.c
index 0f47b3e..fa4f602 100644
--- a/fs/btrfs/extent-tree.c
+++ b/fs/btrfs/extent-tree.c
@@ -5073,6 +5073,8 @@ static noinline int find_free_extent(struct 
btrfs_trans_handle *trans,
ins-objectid = 0;
ins-offset = 0;
 
+   trace_find_free_extent(orig_root, num_bytes, empty_size, data);
+
space_info = __find_space_info(root-fs_info, data);
if (!space_info) {
printk(KERN_ERR No space info for %llu\n, data);
@@ -5258,6 +5260,8 @@ have_block_group:
if (offset) {
/* we have a block, we're done */
spin_unlock(last_ptr-refill_lock);
+   trace_btrfs_reserve_extent_cluster(root,
+   block_group, search_start, num_bytes);
goto checks;
}
 
@@ -5315,6 +5319,9 @@ refill_cluster:
if (offset) {
/* we found one, proceed */
spin_unlock(last_ptr-refill_lock);
+   trace_btrfs_reserve_extent_cluster(root,
+   block_group, search_start,
+   num_bytes);
goto checks;
}
} else if (!cached  loop  LOOP_CACHING_NOWAIT
@@ -5394,6 +5401,8 @@ checks:
ins-objectid = search_start;
ins-offset = num_bytes;
 
+   trace_btrfs_reserve_extent(orig_root, block_group,
+  search_start, num_bytes);
if (offset  search_start)
btrfs_add_free_space(block_group, offset,
 search_start - offset);
diff --git a/fs/btrfs/free-space-cache.c b/fs/btrfs/free-space-cache.c
index 181760f..b3008d3 100644
--- a/fs/btrfs/free-space-cache.c
+++ b/fs/btrfs/free-space-cache.c
@@ -2333,6 +2333,8 @@ again:
 entry-offset_index, 1);
BUG_ON(ret);
 
+   trace_btrfs_setup_cluster(block_group, cluster,
+ total_found * block_group-sectorsize, 1);
return 0;
 }
 
@@ -2355,6 +2357,7 @@ setup_cluster_no_bitmap(struct btrfs_block_group_cache 
*block_group,
u64 window_free;
u64 max_extent;
u64 max_gap = 128 * 1024;
+   u64 total_size = 0;
 
entry = tree_search_offset(ctl, offset, 0, 1);
if (!entry)
@@ -2431,11 +2434,12 @@ setup_cluster_no_bitmap(struct btrfs_block_group_cache 
*block_group,
rb_erase(entry-offset_index, ctl-free_space_offset);
ret = tree_insert_offset(cluster-root, entry-offset,
 entry-offset_index, 0);
+   total_size += entry-bytes;
BUG_ON(ret);
} while (node  entry != last);
 
cluster-max_size = max_extent;
-
+   trace_btrfs_setup_cluster(block_group, cluster, total_size, 0);
return 0;
 }
 
@@ -2560,6 +2564,9 @@ int btrfs_find_space_cluster(struct btrfs_trans_handle 
*trans,
goto out;
}
 
+   trace_btrfs_find_cluster(block_group, offset, bytes, empty_size,
+min_bytes);
+
INIT_LIST_HEAD(bitmaps);
ret = setup_cluster_no_bitmap(block_group, cluster, bitmaps, offset,
  bytes, min_bytes);
@@ -2576,6 +2583,8 @@ int btrfs_find_space_cluster(struct btrfs_trans_handle 
*trans,
list_add_tail(cluster-block_group_list,
  block_group-cluster_list);
cluster-block_group = block_group;
+   } else {
+   trace_btrfs_failed_cluster_setup(block_group);
}
 out:
spin_unlock(cluster-lock);
diff --git a/include/trace/events/btrfs.h b/include/trace/events/btrfs.h
index b31702a..1750c0e 100644
--- a/include/trace/events/btrfs.h
+++ b/include/trace/events/btrfs.h
@@ -16,6 +16,8 @@ struct btrfs_delayed_ref_node;
 struct btrfs_delayed_tree_ref;
 struct btrfs_delayed_data_ref;
 struct btrfs_delayed_ref_head;
+struct btrfs_block_group_cache;
+struct btrfs_free_cluster;
 struct map_lookup;
 struct extent_buffer;
 
@@ -44,6 +46,15 @@ struct extent_buffer;
obj, ((obj = BTRFS_DATA_RELOC_TREE_OBJECTID) ||\

[GIT PULL] Btrfs fixes

2011-11-11 Thread Chris Mason
Hi Linus,

The for-linus branch of the btrfs git tree:

git://git.kernel.org/pub/scm/linux/kernel/git/mason/linux-btrfs.git for-linus
sha: 8965593e41dd2d0e2a2f1e6f245336005ea94a2c

Has our fixes since rc1.  These are pretty small, for the most part
we're nailing some regressions in the mount error handling code and
tweaking the ENOSPC throttling.

My for-linus tree is against 3.1, but this was tested against 3.2-rc1 as
well.

Miao Xie (6) commits (+47/-23):
Btrfs: Abstract similar code for btrfs_block_rsv_add{, _noflush} (+12/-16)
Btrfs: fix deadlock caused by the race between relocation (+2/-2)
Btrfs: fix no reserved space for writing out inode cache (+24/-4)
Btrfs: fix unreleased path in btrfs_orphan_cleanup() (+3/-0)
Btrfs: fix nocow when deleting the item (+4/-1)
Btrfs: fix orphan backref nodes (+2/-0)

Ilya Dryomov (5) commits (+43/-46):
Btrfs: avoid null dereference and leaks when bailing from open_ctree() 
(+15/-20)
Btrfs: close devices on all error paths in open_ctree() (+3/-4)
Btrfs: fix subvol_name leak on error in btrfs_mount() (+3/-1)
Btrfs: fix memory leak in btrfs_parse_early_options() (+1/-0)
Btrfs: rework error handling in btrfs_mount() (+21/-21)

Chris Mason (2) commits (+56/-33):
Btrfs: fix oops on NULL trans handle in btrfs_truncate (+9/-7)
Btrfs: tweak the delayed inode reservations again (+47/-26)

Josef Bacik (2) commits (+93/-16):
Btrfs: only map pages if we know we need them when reading the space cache 
(+10/-7)
Btrfs: fix our reservations for updating an inode when completing io 
(+83/-9)

sly...@gmail.com (1) commits (+5/-3):
btrfs: fix double-free 'tree_root' in 'btrfs_mount()'

Arne Jansen (1) commits (+29/-35):
Btrfs: handle bio_add_page failure gracefully in scrub

David Sterba (1) commits (+2/-2):
btrfs: rename the option to nospace_cache

Total: (18) commits

 fs/btrfs/btrfs_inode.h  |4 +--
 fs/btrfs/delayed-inode.c|   58 +-
 fs/btrfs/disk-io.c  |   42 +
 fs/btrfs/extent-tree.c  |   50 --
 fs/btrfs/free-space-cache.c |   17 +
 fs/btrfs/inode-map.c|   28 --
 fs/btrfs/inode.c|   84 +--
 fs/btrfs/relocation.c   |2 +
 fs/btrfs/scrub.c|   64 +++--
 fs/btrfs/super.c|   49 ++---
 fs/btrfs/transaction.c  |4 +-
 fs/btrfs/volumes.c  |5 ++-
 12 files changed, 262 insertions(+), 145 deletions(-)
--
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: Stupid newb tricks: making a subvolume of root.

2011-11-11 Thread Ken D'Ambrosio
On Fri, 11 Nov 2011 19:13:09 + Hugo Mills h...@carfax.org.uk wrote

I'd suggest reporting (on this mailing list) the panic message(s)
 you got, and how you got to them. I know there's been quite a few
 additional patches worked on since Chris pushed out the stack for
 -rc1, so it's quite plausible that your particular problem has already
 been fixed in someone's tree.

Hmmm.  I just pulled Chris's tree, and it seems to have done the trick.  It's
mounting, now.  I'm being leery of outright deleting, because grub-mkconfig
seems confused about being mounted off a different subvolume:
grub-probe: error: cannot find a device for / (is /dev/mounted?).

(Needless to say, /dev/ *is* mounted.  Likely, I've somehow confused it with
fstab or something.)

But I'm able to look at directories, cat/cp files, etc., so I now at least
*could* blow things away.  Which is handy.

Thanks!

-Ken





--
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: Stupid newb tricks: making a subvolume of root.

2011-11-11 Thread Hugo Mills
On Fri, Nov 11, 2011 at 04:47:17PM -0500, Ken D'Ambrosio wrote:
 On Fri, 11 Nov 2011 19:13:09 + Hugo Mills h...@carfax.org.uk wrote
 
 I'd suggest reporting (on this mailing list) the panic message(s)
  you got, and how you got to them. I know there's been quite a few
  additional patches worked on since Chris pushed out the stack for
  -rc1, so it's quite plausible that your particular problem has already
  been fixed in someone's tree.
 
 Hmmm.  I just pulled Chris's tree, and it seems to have done the trick.  It's
 mounting, now.  I'm being leery of outright deleting, because grub-mkconfig
 seems confused about being mounted off a different subvolume:
 grub-probe: error: cannot find a device for / (is /dev/mounted?).
 
 (Needless to say, /dev/ *is* mounted.  Likely, I've somehow confused it with
 fstab or something.)

   I think grub has some problems with some of the btrfs features. I
don't know if we've got a decent list of issues written down yet.

 But I'm able to look at directories, cat/cp files, etc., so I now at least
 *could* blow things away.  Which is handy.

   Glad the upgrade's helped. Just make sure you've got off-machine
backups, and the will to use them, and you'll be fine. :)

   Hugo.

-- 
=== Hugo Mills: hugo@... carfax.org.uk | darksatanic.net | lug.org.uk ===
  PGP key: 515C238D from wwwkeys.eu.pgp.net or http://www.carfax.org.uk
 --- I always felt that as a C programmer, I --- 
 was becoming typecast.  


signature.asc
Description: Digital signature


Re: Announcing btrfs-gui

2011-11-11 Thread Amedee Van Gasse

On 02-06-11 01:20, Hugo Mills wrote:

*snip*


Like all silly ideas, this one got a bit out of hand, and seems to
have turned into something vaguely useful. I'm therefore pleased to
announce the first major public release of btrfs-gui[1]: a point-and-
click tool for managing btrfs filesystems.

The tool currently can scan for and list btrfs filesystems and the
volumes they live on. It can show the allocation and usage of data in
a selected filesystem, categorised by use, replication, and device. It
can show and manipulate subvolumes and snapshots: creation, deletion,
and setting the default. For those with servers to manage, it also has
the ability to ssh into a remote machine, and manage its filesystems
remotely (so you don't have to have X installed on your servers just
to use btrfs-gui on them).


*snip*


Unless the traffic gets too high-volume, or unless someone
important objects, I'm going to suggest that bug reports should go to
this list for now (cc'd me, if you like). Note that this isn't an
offical btrfs project -- it's just something I knocked together on
my own.



I seem to have stumbled upon a bug.
During install, Ubuntu gives the user the option to use btrfs as the 
root filesystem. It automatically creates two subvolumes, @ (for /) and 
@home (for /home, only if no other partition is used for /home), like this:


mount | grep btrfs
/dev/sda6 on / type btrfs (rw,subvol=@)
/dev/sda6 on /home type btrfs (rw,subvol=@home)
/dev/sda6 on 
/tmp/btrfs-gui-kl6zx1/12624/eba4f1e9-5b55-4e14-abb8-5a3cf3625c56 type 
btrfs (rw,subvolid=0)


When gtrfs-gui scans for filesystems, it gives the error
Root helper exception: b'@' is not JSON serializable

This is the relevant console output:

Helper: found label None, UUID eba4f1e9-5b55-4e14-abb8-5a3cf3625c56
Helper: found dev 1 = /dev/sda6
Helper: Created private directory /tmp/btrfs-gui-kl6zx1
Helper: Mounted filesystem UUID=eba4f1e9-5b55-4e14-abb8-5a3cf3625c56 at 
/tmp/btrfs-gui-kl6zx1/12624/eba4f1e9-5b55-4e14-abb8-5a3cf3625c56

Traceback (most recent call last):
  File /usr/local/lib/python3.2/dist-packages/btrfsgui/hlp/helper.py, 
line 40, in main

COMMANDS[command](parameters)
  File /usr/local/lib/python3.2/dist-packages/btrfsgui/hlp/subvol.py, 
line 126, in sv_list

sys.stdout.write(json.dumps(res))
  File /usr/lib/python3.2/json/__init__.py, line 224, in dumps
return _default_encoder.encode(obj)
  File /usr/lib/python3.2/json/encoder.py, line 188, in encode
chunks = self.iterencode(o, _one_shot=True)
  File /usr/lib/python3.2/json/encoder.py, line 246, in iterencode
return _iterencode(o, 0)
  File /usr/lib/python3.2/json/encoder.py, line 170, in default
raise TypeError(repr(o) +  is not JSON serializable)
TypeError: b'@' is not JSON serializable


Kind regards,
Amedee Van Gasse
ame...@vangasse.eu
--
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