[PATCH] Btrfs: init device stats for new devices

2013-10-11 Thread Stefan Behrens
Device stats are only initialized (read from tree items) on mount. Trying to read device stats after adding or replacing new devices will return errors. btrfs_init_new_device() and btrfs_init_dev_replace_tgtdev() are the two functions that allocate and initialize new btrfs_device structures after

Re: [PATCH] Btrfs: init device stats for new devices

2013-10-11 Thread Zach Brown
diff --git a/fs/btrfs/volumes.c b/fs/btrfs/volumes.c index 646d10d..9837439 100644 --- a/fs/btrfs/volumes.c +++ b/fs/btrfs/volumes.c @@ -2041,6 +2041,7 @@ int btrfs_init_new_device(struct btrfs_root *root, char *device_path) device-in_fs_metadata = 1;

Re: [PATCH] Btrfs: init device stats for new devices

2013-10-11 Thread Zach Brown
a filesystem is mounted. They set the device stats to zero by using kzalloc() which is correct for new devices. Oh, right, got it :) - z -- 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

Re: [PATCH] btrfs: init device stats for new devices

2013-10-07 Thread Stefan Behrens
:48:05 -0400 Subject: [PATCH] btrfs: init device stats for new devices Device stats are only initialized (read from tree items) on mount. Trying to read device stats after adding or replacing new devices will return errors. This cheesy patch demonstrates the problem, but this should really

Re: [PATCH] btrfs: init device stats for new devices

2013-09-30 Thread Ondřej Kunc
-0400 Subject: [PATCH] btrfs: init device stats for new devices Device stats are only initialized (read from tree items) on mount. Trying to read device stats after adding or replacing new devices will return errors. This cheesy patch demonstrates the problem, but this should really

Re: [PATCH] btrfs: init device stats for new devices

2013-09-30 Thread Zach Brown
On Tue, Oct 01, 2013 at 12:03:05AM +0200, Ondřej Kunc wrote: Hi Zach, thank you for your answer and clarification. I cannot just unmount and mount that filesystem, because it is running busy NFS server now, so I will just try it on some testbench server. Can mount -o remount be sufficient