Filipe David Borba Manana | 24 Apr 16:15 2014
Picon

[PATCH] Btrfs: use correct key when repeating search for extent item

If skinny metadata is enabled and our first tree search fails to find a
skinny extent item, we may repeat a tree search for a "fat" extent item
(if the previous item in the leaf is not the "fat" extent we're looking
for). However we were not setting the new key's objectid to the right
value, as we previously used the same key variable to peek at the previous
item in the leaf, which has a different objectid. So just set the right
objectid to avoid modifying/deleting a wrong item if we repeat the tree
search.

Signed-off-by: Filipe David Borba Manana <fdmanana <at> gmail.com>
---
 fs/btrfs/extent-tree.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/fs/btrfs/extent-tree.c b/fs/btrfs/extent-tree.c
index 1306487..678cb35 100644
--- a/fs/btrfs/extent-tree.c
+++ b/fs/btrfs/extent-tree.c
 <at>  <at>  -1542,6 +1542,7  <at>  <at>  again:
 				ret = 0;
 		}
 		if (ret) {
+			key.objectid = bytenr;
 			key.type = BTRFS_EXTENT_ITEM_KEY;
 			key.offset = num_bytes;
 			btrfs_release_path(path);
 <at>  <at>  -5719,6 +5720,7  <at>  <at>  static int __btrfs_free_extent(struct btrfs_trans_handle *trans,

 			if (ret > 0 && skinny_metadata) {
 				skinny_metadata = false;
(Continue reading)

David Sterba | 24 Apr 15:09 2014
Picon

[PATCH] btrfs: make FS_INFO ioctl available to anyone

This ioctl provides basic info about the filesystem that can be obtained
in other ways (eg. sysfs), there's no reason to restrict it to
CAP_SYSADMIN.

Signed-off-by: David Sterba <dsterba <at> suse.cz>
---
 fs/btrfs/ioctl.c |    3 ---
 1 files changed, 0 insertions(+), 3 deletions(-)

diff --git a/fs/btrfs/ioctl.c b/fs/btrfs/ioctl.c
index e79ff6b90cb7..f6073375b39e 100644
--- a/fs/btrfs/ioctl.c
+++ b/fs/btrfs/ioctl.c
 <at>  <at>  -2557,9 +2557,6  <at>  <at>  static long btrfs_ioctl_fs_info(struct btrfs_root *root, void __user *arg)
 	struct btrfs_fs_devices *fs_devices = root->fs_info->fs_devices;
 	int ret = 0;

-	if (!capable(CAP_SYS_ADMIN))
-		return -EPERM;
-
 	fi_args = kzalloc(sizeof(*fi_args), GFP_KERNEL);
 	if (!fi_args)
 		return -ENOMEM;
--

-- 
1.7.9

--
To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in
the body of a message to majordomo <at> vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
(Continue reading)

David Sterba | 24 Apr 15:09 2014
Picon

[PATCH] btrfs: make DEV_INFO ioctl available to anyone

This ioctl provides basic info about the devices that can be obtained in
other ways (eg. sysfs), there's no reason to restrict it to
CAP_SYSADMIN.

Signed-off-by: David Sterba <dsterba <at> suse.cz>
---
 fs/btrfs/ioctl.c |    3 ---
 1 files changed, 0 insertions(+), 3 deletions(-)

diff --git a/fs/btrfs/ioctl.c b/fs/btrfs/ioctl.c
index e79ff6b90cb7..4aef4f2c5b50 100644
--- a/fs/btrfs/ioctl.c
+++ b/fs/btrfs/ioctl.c
 <at>  <at>  -2589,9 +2589,6  <at>  <at>  static long btrfs_ioctl_dev_info(struct btrfs_root *root, void __user *arg)
 	int ret = 0;
 	char *s_uuid = NULL;

-	if (!capable(CAP_SYS_ADMIN))
-		return -EPERM;
-
 	di_args = memdup_user(arg, sizeof(*di_args));
 	if (IS_ERR(di_args))
 		return PTR_ERR(di_args);
--

-- 
1.7.9

--
To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in
the body of a message to majordomo <at> vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
(Continue reading)

Wang Shilong | 24 Apr 12:51 2014

[PATCH v2 3/3] Btrfs-progs: fsck: add ability to check reloc roots

When encountering system crash or balance enospc errors,
there maybe still some reloc roots left.

The way we store reloc root is different from fs root:

reloc root's root key(BTRFS_RELOC_TREE_OBJECTID, ROOT_ITEM, objectid)
fs root's root key(objectid, ROOT_ITEM, -1)
reloc data's root key(BTRFS_DATA_RELOC_TREE_OBJECTID, ROOT_ITEM, 0)

So this patch use right key to search corresponding root node, and
avoid using normal fs root cache for reloc roots.

Signed-off-by: Wang Shilong <wangsl.fnst <at> cn.fujitsu.com>
---
v1->v2: fix memory leaks and use normal fs root cache for data
	relocation root node.
---
 cmds-check.c | 33 ++++++++++++++++++++++++++-------
 1 file changed, 26 insertions(+), 7 deletions(-)

diff --git a/cmds-check.c b/cmds-check.c
index e6fb380..2a87398 100644
--- a/cmds-check.c
+++ b/cmds-check.c
 <at>  <at>  -299,8 +299,22  <at>  <at>  static struct inode_record *clone_inode_rec(struct inode_record *orig_rec)
 	return rec;
 }

-static void print_inode_error(int errors)
+static void print_inode_error(struct btrfs_root *root, struct inode_record *rec)
(Continue reading)

Pete | 24 Apr 08:39 2014
Picon

bedup - De-duplication and snapshots

Dear All,

I have a very slow deduplication going on on an external usb disk.  I'm
using it for backups - I rsync the relevent files to the disk and then
take a snapshot.  I then deduplicate with bedup dedup <disk-mount-point>

What I am finding is that it is reporting a deduplication between the
data on the disk and its snapshot e.g.:

Deduplicated:
-
u'/mnt/floppy/_home/ftp/pub/Linux/Slackware/slackware-current/slackware/t/tetex-3.0-i486-7.txz'
-
u'/mnt/floppy/snapshots/_home_20131205T15:02:33/ftp/pub/Linux/Slackware/slackware32-13.37/slackware/t/tetex-3.0-i486-7.txz'

(don't worry, I promise it is an external usb drive and not a floppy!)

However, I thought that would not be necessary as one would merely be a
snapshot of the other.  Running 3.13.6.  Unfortunately bedup does not
give a version number.

kind regards,

Pete

--
To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in
the body of a message to majordomo <at> vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

(Continue reading)

Gui Hecheng | 24 Apr 05:39 2014

[PATCH] btrfs-progs: prevent close_root if the root to close is potentially NULL

Originally only if 'block_only' is specified, the 'fs_root == NULL'
will be checked. But if 'block_only' is not specified and close_root
will be called blindly without checking 'fs_root == NULL', which is
unsafe.

Signed-off-by: Gui Hecheng <guihc.fnst <at> cn.fujitsu.com>
---
 btrfs-debug-tree.c | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/btrfs-debug-tree.c b/btrfs-debug-tree.c
index 8ae7270..cb6c106 100644
--- a/btrfs-debug-tree.c
+++ b/btrfs-debug-tree.c
 <at>  <at>  -177,13 +177,14  <at>  <at>  int main(int ac, char **av)
 		fprintf(stderr, "unable to open %s\n", av[optind]);
 		exit(1);
 	}
+
 	root = info->fs_root;
+	if (!root) {
+		fprintf(stderr, "unable to open %s\n", av[optind]);
+		exit(1);
+	}

 	if (block_only) {
-		if (!root) {
-			fprintf(stderr, "unable to open %s\n", av[optind]);
-			exit(1);
-		}
(Continue reading)

Wang Shilong | 24 Apr 05:19 2014

[PATCH 1/3] Btrfs-progs: fsck: clear out log tree in repair mode

Repair mode will commit transaction which will make us
fail to load log tree anymore.

Give a warning to common users, if they really want to
coninue, we will clear out log tree.

Signed-off-by: Wang Shilong <wangsl.fnst <at> cn.fujitsu.com>
---
 cmds-check.c | 33 +++++++++++++++++++++++++++++++++
 1 file changed, 33 insertions(+)

diff --git a/cmds-check.c b/cmds-check.c
index 93f9ae6..15806a4 100644
--- a/cmds-check.c
+++ b/cmds-check.c
 <at>  <at>  -6615,6 +6615,22  <at>  <at>  out:
 	return ret;
 }

+static int zero_log_tree(struct btrfs_root *root)
+{
+	struct btrfs_trans_handle *trans;
+	int ret;
+
+	trans = btrfs_start_transaction(root, 1);
+	if (IS_ERR(trans)) {
+		ret = PTR_ERR(trans);
+		return ret;
+	}
+	btrfs_set_super_log_root(root->fs_info->super_copy, 0);
(Continue reading)

Marc MERLIN | 24 Apr 03:18 2014

Which companies contribute to Btrfs?

Howdy,

I writing slides about btrfs for an upcoming talk (at linuxcon) and I was
trying to gather a list of companies that contribute code to btrfs.

What I came up with (sorted alphabetically)
Couchbase (CouchDB)
Facebook 
Fujitsu
Fusion-IO
Oracle
SGI
Suse

Are there other companies I missed?

Thanks,
Marc
--

-- 
"A mouse is a device used to point at the xterm you want to type in" - A.S.R.
Microsoft is to operating systems ....
                                      .... what McDonalds is to gourmet cooking
Home page: http://marc.merlins.org/  
--
To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in
the body of a message to majordomo <at> vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Robert White | 24 Apr 00:30 2014
Picon

Cycle of send/receive for backup/restore is incomplete...

So the backup/restore system described using snapshots is incomplete 
because the final restore is a copy operation. As such, the act of 
restoring from the backup will require restarting the entire backup 
cycle because the copy operation will scramble the metadata consanguinity.

The real choice is to restore by sending the snapshot back via send and 
receive so that all the UIDs and metadata continue to match up.

But there's no way to "promote" the final snapshot to a non-snapshot 
subvolume identical to the one made by the original btrfs subvolume 
create operation.

Consider a file system with __System as the default mount (e.g. btrfs 
subvolume create /__System). You make a snapshot (btrfs sub snap -r 
/__System /__System_BACKUP). Then you send the backup to another file 
system with send receive. Nothing new here.

The thing is, if you want to restore from that backup, you'd 
send/receive /__System_BACKUP to the new/restore drive. But that 
snapshot is _forced_ to be read only. So then your only choice is to 
make a writable snapshot called /__System. At this point you have a tiny 
problem, the three drives aren't really the same.

The __System and __System_BACKUP on the final drive are subvolumes of /, 
while on the original system / and /__System were full subvolumes.

It's dumb, it's a tiny difference, but it's annoying. There needs to be 
a way to promote /__System to a non-snapshot status.

If you look at the output of "btrfs subvolume list -s /" on the various 
(Continue reading)

Sergey Ivanyuk | 23 Apr 23:04 2014
Picon

raid6, disks of different sizes, ENOSPC errors despite having plenty of space

Hi,

I have a filesystem that I've converted to raid6 from raid1, on 4 drives (I
have another copy of the data):

        Total devices 4 FS bytes used 924.64GiB
        devid    1 size 1.82TiB used 474.00GiB path /dev/sdd
        devid    2 size 465.76GiB used 465.76GiB path /dev/sda
        devid    3 size 465.76GiB used 465.76GiB path /dev/sdb
        devid    4 size 465.76GiB used 465.73GiB path /dev/sdc

Data, RAID6: total=924.00GiB, used=923.42GiB
System, RAID1: total=32.00MiB, used=208.00KiB
Metadata, RAID1: total=1.70GiB, used=1.28GiB
Metadata, DUP: total=384.00MiB, used=252.13MiB
unknown, single: total=512.00MiB, used=0.00

Recent btrfs-progs built from source, kernel 3.15.0-rc2 on armv7l. Despite
having plenty of space left on the larger drive, attempting to copy more
data onto the filesystem results in a kworker process pegged at 100% CPU
for a very long time (10s of minutes), at which point the writes proceed
for some time, and the process repeats until the eventual "No space left on
device" error. Balancing fails with the same error, even if attempting to
convert back to raid1.

I realize that this likely has something to do with the disparity between
device sizes, and per the wiki a fixed-width stripe may help, though I'm
not sure if it's possible to change the stripe width in my situation, since
I can't rebalance. Is there anything I can do to get this filesystem back
to writable state?
(Continue reading)

Robert White | 23 Apr 22:44 2014
Picon

hung task timer + btrfs_convert or btrfs balance = OOPS

The first mount of a non-trivial file system after a btrfs_convert, or 
an ongoing btrfs balance operation containing large files may lead to an 
oops (and a pathologically damaged file system) if the hang check timer 
(CONFIG_DETECT_HUNG_TASK=y) is compiled into the linux kernel and not 
disabled.

I've had two systems destroyed after a btrfs_convert. After the 
conversion the first mount took several minutes. The hung task timer 
expired against some internal btrfs_daemon. I think it was 
'[btrfs-transacti]'. Said task then goes oops and the file system was 
chock full of errors. So many that I no longer trusted the conversion so 
mkfs.btrfs and restored from backup.

On another system the same thing happened after a successful convert and 
mount (I'd remembered to disable the timer during the first mount) when 
a btrfs balance was running.

Whatever is blocking in that task really ought not to do that for 2+ 
minutes and sleep on some data structure instead.

As it is, the two options are not happy together. Be sure to

echo 0 > /proc/sys/kernel/hung_task_timeout_secs

to disable the timer before doing a mount or balance after a 
btrfs_convert (and possibly a btrfs balance if it decides to move a very 
large file like a VM disk image).

--
To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in
(Continue reading)


Gmane