Re: Newbie questions on some of btrfs code...

2012-05-22 Thread Alex Lyakas
Thanks, Liu, that clarifies. Alex. On Tue, May 22, 2012 at 4:42 AM, Liu Bo liubo2...@cn.fujitsu.com wrote: On 05/21/2012 06:05 PM, Alex Lyakas wrote: Hi Liu, thanks for the clarifications. I did not understand the dd example of yours, though. So for the following situation:       item

Re: Ceph on btrfs 3.4rc

2012-05-22 Thread Christian Brunner
2012/5/21 Miao Xie mi...@cn.fujitsu.com: Hi Josef, On fri, 18 May 2012 15:01:05 -0400, Josef Bacik wrote: diff --git a/fs/btrfs/btrfs_inode.h b/fs/btrfs/btrfs_inode.h index 9b9b15f..492c74f 100644 --- a/fs/btrfs/btrfs_inode.h +++ b/fs/btrfs/btrfs_inode.h @@ -57,9 +57,6 @@ struct

[PATCH v4 0/3] Btrfs: add IO error device stats

2012-05-22 Thread Stefan Behrens
Changes v1-v2: - Remove restriction that BTRFS_IOC_GET_DEVICE_STATS is a privileged operation - Cast u64 to unsigned long long for printf() Changes v2-v3: - Rebased on Chris' current master Changes v3-v4: - Add padding at end of ioctl structure The goal is to detect when drives start to get

[PATCH v4 3/3] Btrfs: read device stats on mount, write modified ones during commit

2012-05-22 Thread Stefan Behrens
The device statistics are written into the device tree with each transaction commit. Only modified statistics are written. When a filesystem is mounted, the device statistics for each involved device are read from the device tree and used to initialize the counters. Signed-off-by: Stefan Behrens

[PATCH v4 2/3] Btrfs: add ioctl to get and reset the device stats

2012-05-22 Thread Stefan Behrens
An ioctl interface is added to get the device statistic counters. A second ioctl is added to atomically get and reset these counters. Signed-off-by: Stefan Behrens sbehr...@giantdisaster.de --- fs/btrfs/ioctl.c | 26 fs/btrfs/ioctl.h | 28 +

[PATCH v4 1/3] Btrfs: add device counters for detected IO and checksum errors

2012-05-22 Thread Stefan Behrens
The goal is to detect when drives start to get an increased error rate, when drives should be replaced soon. Therefore statistic counters are added that count IO errors (read, write and flush). Additionally, the software detected errors like checksum errors and corrupted blocks are counted.

[PATCH v4 2/3] Btrfs-progs: make two utility functions globally available

2012-05-22 Thread Stefan Behrens
Two convenient utility functions that have so far been local to scrub are moved to utils.c. They will be used in the device stats code in a following commit. Signed-off-by: Stefan Behrens sbehr...@giantdisaster.de --- cmds-scrub.c | 72 ++

[PATCH v4 0/3] Btrfs-progs: support get/reset device stats via ioctl

2012-05-22 Thread Stefan Behrens
btrfs device stats is used to retrieve and print the device stats. btrfs device stats -z is used to atomically retrieve, reset and print the stats. In order to share two utility functions between scrub and the dev stats code, these two functions are moved to utils.c and renamed. Since these

[PATCH v4 1/3] Btrfs-progs: move open_file_or_dir() to utils.c

2012-05-22 Thread Stefan Behrens
This is a preparation step to add support for device stats. The definition of the function open_file_or_dir() is moved from common.c to utils.c in order to be able to share some common code between scrub and the device stats in the following step. That common code uses open_file_or_dir(). Since

[PATCH v4 3/3] Btrfs-progs: add command to get/reset device stats via ioctl

2012-05-22 Thread Stefan Behrens
btrfs device stats is used to retrieve and print the device stats. btrfs device stats -z is used to atomically retrieve, reset and print the stats. Signed-off-by: Stefan Behrens sbehr...@giantdisaster.de --- cmds-device.c | 113 ctree.h

Re: [PATCH 2/4] Btrfs: fix deadlock on sb-s_umount when doing umount

2012-05-22 Thread David Sterba
On Wed, May 09, 2012 at 11:24:28AM +0800, Miao Xie wrote: Did you apply the trylock patchs I sent before? 20120429 [PATCH 1/2] vfs: re-implement writeback_inodes_sb(_nr)_if_idle() and rename them 20120429 [PATCH 2/2] Btrfs: flush all the dirty pages if try_to_writeback_inodes_sb_nr() fails

Re: 3.4.0-rc6: WARNING: at fs/btrfs/super.c:219 __btrfs_abort_transaction+0xae/0xc0 [btrfs]()

2012-05-22 Thread Arnd Hannemann
Hi, I just got the same warning on a fresh 3.4.0 final while booting. This time on /usr/share (different filesystem from last time): arnd@kallisto:~$ ls -l /dev/mapper/vg0-usr_share lrwxrwxrwx 1 root root 7 Mai 22 17:59 /dev/mapper/vg0-usr_share - ../dm-4 arnd@kallisto:~$ grep usr_share

warnings met in introduce extent buffer cache for each i-node patch

2012-05-22 Thread Tim Chen
Miao, I was trying out your patch on scalability testing for BTRFS on v3.3 kernel. http://www.mail-archive.com/linux-btrfs@vger.kernel.org/msg14930.html However, I ran into a lot of warnings (see the dmesg below). Wonder if you have a more up to date version of this patch? In addition, I have

Which is the maximum files size in BTRFS ? [was Re: btrfs: Probably the larger filesystem I will see for a long time]

2012-05-22 Thread Goffredo Baroncelli
Hi all, From the specification [1] the btrfs maximum file size limit should be 164 bytes. However I was never able to create a file = 163 bytes. ghigo@venice:/mnt/old-btrfs/home/ghigo/gianfile$ ls -l giantfile2 -rw-r--r-- 1 ghigo ghigo 9223372036854775807 May 22 18:55 giantfile2

Re: Ceph on btrfs 3.4rc

2012-05-22 Thread Josef Bacik
On Tue, May 22, 2012 at 12:29:59PM +0200, Christian Brunner wrote: 2012/5/21 Miao Xie mi...@cn.fujitsu.com: Hi Josef, On fri, 18 May 2012 15:01:05 -0400, Josef Bacik wrote: diff --git a/fs/btrfs/btrfs_inode.h b/fs/btrfs/btrfs_inode.h index 9b9b15f..492c74f 100644 ---

Re: Which is the maximum files size in BTRFS ? [was Re: btrfs: Probably the larger filesystem I will see for a long time]

2012-05-22 Thread Goffredo Baroncelli
On 05/22/2012 07:17 PM, Goffredo Baroncelli wrote: Hi all, From the specification [1] the btrfs maximum file size limit should be 164 bytes. However I was never able to create a file = 163 bytes. ghigo@venice:/mnt/old-btrfs/home/ghigo/gianfile$ ls -l giantfile2 -rw-r--r-- 1 ghigo ghigo

Re: SSD format/mount parameters questions

2012-05-22 Thread Martin
On 19/05/12 18:36, Martin Steigerwald wrote: Am Freitag, 18. Mai 2012 schrieb Sander: Martin wrote (ao): Are there any format/mount parameters that should be set for using btrfs on SSDs (other than the ssd mount option)? If possible, format the whole device, do not partition the ssd. This

SSD erase state and reducing SSD wear

2012-05-22 Thread Martin
I've got two recent examples of SSDs. Their pristine state from the manufacturer shows: Device Model: OCZ-VERTEX3 # hexdump -C /dev/sdd 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 || * 1bf2976000 Device Model: OCZ VERTEX PLUS (OCZ VERTEX 2E) # hexdump -C

Re: Newbie questions on some of btrfs code...

2012-05-22 Thread Jan Schmidt
On 22.05.2012 10:07, Alex Lyakas wrote: # If my understanding in the previous bullet is correct: Is that the reason that in btrfs_prev_leaf() it is assumed that if there is a lesser key, btrfs_search_slot() will never bring us to the slot==0 of the current leaf? It's quite straight: We look

Re: warnings met in introduce extent buffer cache for each i-node patch

2012-05-22 Thread Miao Xie
On Tue, 22 May 2012 09:54:54 -0700, Tim Chen wrote: Miao, I was trying out your patch on scalability testing for BTRFS on v3.3 kernel. http://www.mail-archive.com/linux-btrfs@vger.kernel.org/msg14930.html However, I ran into a lot of warnings (see the dmesg below). Wonder if you have a

Re: [PATCH v4 3/3] Btrfs: read device stats on mount, write modified ones during commit

2012-05-22 Thread Liu Bo
On 05/22/2012 06:53 PM, Stefan Behrens wrote: The device statistics are written into the device tree with each transaction commit. Only modified statistics are written. When a filesystem is mounted, the device statistics for each involved device are read from the device tree and used to

Re: SSD erase state and reducing SSD wear

2012-05-22 Thread Calvin Walton
On Tue, 2012-05-22 at 22:47 +0100, Martin wrote: I've got two recent examples of SSDs. Their pristine state from the manufacturer shows: Device Model: OCZ-VERTEX3 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 Device Model: OCZ VERTEX PLUS ff ff ff ff ff ff ff

Re: [PATCH 2/2] Btrfs: resize all devices when we dont assign a specific device id

2012-05-22 Thread Goffredo Baroncelli
Hi On 05/17/2012 02:08 PM, Liu Bo wrote: This patch fixes two bugs: When we do not assigne a device id for the resizer, - it will only take one device to resize, which is supposed to apply on all available devices. - it will take 'id 1' device as default, and this will cause a bug as we