Re: [PATCH] Deny sys_link across subvolumes.

2009-11-12 Thread TARUISI Hiroaki
Chris Mason wrote: > On Thu, Nov 12, 2009 at 04:14:26PM +0900, TARUISI Hiroaki wrote: >> From: Christian Parpart >> >> I rebased Christian Parpart's patch to deny hard link across >> subvolumes. Original patch modifies also btrfs_rename, but >> I excluded it because we can move across subvolumes n

Re: btrfsck: checksum verify failed

2009-11-12 Thread Alexander Beregalov
2009/11/12 Chris Mason : > On Thu, Nov 12, 2009 at 08:41:44PM +0300, Alexander Beregalov wrote: >> 2009/11/12 Chris Mason : >> > On Thu, Nov 12, 2009 at 06:43:00PM +0300, Alexander Beregalov wrote: >> >> 2009/11/12 Chris Mason : >> >> > On Thu, Nov 12, 2009 at 05:16:34PM +0300, Alexander Beregalov

Re: btrfsck: checksum verify failed

2009-11-12 Thread Chris Mason
On Thu, Nov 12, 2009 at 08:41:44PM +0300, Alexander Beregalov wrote: > 2009/11/12 Chris Mason : > > On Thu, Nov 12, 2009 at 06:43:00PM +0300, Alexander Beregalov wrote: > >> 2009/11/12 Chris Mason : > >> > On Thu, Nov 12, 2009 at 05:16:34PM +0300, Alexander Beregalov wrote: > >> >> 2009/11/12 Chris

Re: btrfsck: checksum verify failed

2009-11-12 Thread Alexander Beregalov
2009/11/12 Chris Mason : > On Thu, Nov 12, 2009 at 06:43:00PM +0300, Alexander Beregalov wrote: >> 2009/11/12 Chris Mason : >> > On Thu, Nov 12, 2009 at 05:16:34PM +0300, Alexander Beregalov wrote: >> >> 2009/11/12 Chris Mason : >> >> > On Thu, Nov 12, 2009 at 05:08:53AM +0300, Alexander Beregalov

Re: btrfsck: checksum verify failed

2009-11-12 Thread Chris Mason
On Thu, Nov 12, 2009 at 06:43:00PM +0300, Alexander Beregalov wrote: > 2009/11/12 Chris Mason : > > On Thu, Nov 12, 2009 at 05:16:34PM +0300, Alexander Beregalov wrote: > >> 2009/11/12 Chris Mason : > >> > On Thu, Nov 12, 2009 at 05:08:53AM +0300, Alexander Beregalov wrote: > >> >> # for i in `seq

Re: btrfsck: checksum verify failed

2009-11-12 Thread Alexander Beregalov
2009/11/12 Chris Mason : > On Thu, Nov 12, 2009 at 05:16:34PM +0300, Alexander Beregalov wrote: >> 2009/11/12 Chris Mason : >> > On Thu, Nov 12, 2009 at 05:08:53AM +0300, Alexander Beregalov wrote: >> >> # for i in `seq 1 20`; do btrfsck /dev/sde|grep "checksum verify >> >> failed";echo; done >> >>

Re: [PATCH] Deny sys_link across subvolumes.

2009-11-12 Thread Chris Mason
On Thu, Nov 12, 2009 at 04:14:26PM +0900, TARUISI Hiroaki wrote: > > From: Christian Parpart > > I rebased Christian Parpart's patch to deny hard link across > subvolumes. Original patch modifies also btrfs_rename, but > I excluded it because we can move across subvolumes now and > it make no pr

Re: btrfsck: checksum verify failed

2009-11-12 Thread Chris Mason
On Thu, Nov 12, 2009 at 05:16:34PM +0300, Alexander Beregalov wrote: > 2009/11/12 Chris Mason : > > On Thu, Nov 12, 2009 at 05:08:53AM +0300, Alexander Beregalov wrote: > >> # for i in `seq 1 20`; do btrfsck /dev/sde|grep "checksum verify > >> failed";echo; done > >> checksum verify failed on 31945

Re: btrfsck: checksum verify failed

2009-11-12 Thread Alexander Beregalov
2009/11/12 Chris Mason : > On Thu, Nov 12, 2009 at 05:08:53AM +0300, Alexander Beregalov wrote: >> # for i in `seq 1 20`; do btrfsck /dev/sde|grep "checksum verify >> failed";echo; done >> checksum verify failed on 31945617408 wanted 6607632D found 9CC3ED0 >> checksum verify failed on 31945617408 w

Re: btrfsck: checksum verify failed

2009-11-12 Thread Chris Mason
On Thu, Nov 12, 2009 at 05:08:53AM +0300, Alexander Beregalov wrote: > # for i in `seq 1 20`; do btrfsck /dev/sde|grep "checksum verify > failed";echo; done > checksum verify failed on 31945617408 wanted 6607632D found 9CC3ED0 > checksum verify failed on 31945617408 wanted 6607632D found AFBBF41 W

[PATCH 06/12] Btrfs: Avoid orphan inodes cleanup during committing transaction

2009-11-12 Thread Yan, Zheng
btrfs_lookup_dentry may trigger orphan cleanup, so it's not good to call it during committing transaction. Signed-off-by: Yan Zheng --- fs/btrfs/ioctl.c | 29 + fs/btrfs/transaction.c |4 2 files changed, 17 insertions(+), 16 deletions(-) diff --git

[PATCH 10/12] Btrfs: Add delayed iput

2009-11-12 Thread Yan, Zheng
iput() can trigger new transactions if we are dropping the final reference, so calling it in btrfs_commit_transaction may end up deadlock. This patch adds delayed iput to avoid the issue. Signed-off-by: Yan Zheng --- fs/btrfs/ctree.h|7 +- fs/btrfs/disk-io.c |3 ++ fs/bt

[PATCH 12/12] Btrfs: Fix per root used space accounting

2009-11-12 Thread Yan, Zheng
The bytes_used field in root item was originally planned to trace the amount of used data and tree blocks. But it never worked right since we can't trace freeing of data accurately. This patch changes it to only trace the amount of tree blocks. Signed-off-by: Yan Zheng --- fs/btrfs/ctree.c

[PATCH 11/12] Btrfs: Fix btrfs_drop_extent_cache for skip pinned case

2009-11-12 Thread Yan, Zheng
The check for skip pinned case is wrong, it may breaks the while loop immaturely. Signed-off-by: Yan Zheng --- fs/btrfs/file.c | 10 +++--- 1 files changed, 3 insertions(+), 7 deletions(-) diff --git a/fs/btrfs/file.c b/fs/btrfs/file.c index a4a6d2c..a78fb9b 100644 --- a/fs/btrfs/file.c +

[PATCH 08/12] Btrfs: Make truncate(2) more ENOSPC friendly

2009-11-12 Thread Yan, Zheng
truncating and deleting regular file are unbound operations, so it's not good to do them in a single transaction. This patch makes btrfs_truncate and btrfs_delete_inode start a new transaction after all items in a tree leaf are deleted. Signed-off-by: Yan Zheng --- fs/btrfs/inode.c | 316 +

[PATCH 09/12] Btrfs: Pass transaction handle to security and ACL initialization functions

2009-11-12 Thread Yan, Zheng
Pass transaction handle down to security and ACL initialization functions, so we can avoid starting nested transactions Signed-off-by: Yan Zheng --- fs/btrfs/acl.c | 23 -- fs/btrfs/ctree.h| 13 ++-- fs/btrfs/dir-item.c | 19 --- fs/btrfs/inode.c| 15

[PATCH 07/12] Btrfs: Make fallocate(2) more ENOSPC friendly

2009-11-12 Thread Yan, Zheng
fallocate(2) may allocate large number of file extents, so it's not good to do it in a single transaction. This patch make fallocate(2) start a new transaction for each file extents it allocates. Signed-off-by: Yan Zheng --- fs/btrfs/inode.c | 65 ++-

[PATCH 05/12] Btrfs: Avoid orphan inodes cleanup during replaying log

2009-11-12 Thread Yan, Zheng
We do log replay in a single transaction, so it's not good to do unbound operations during replaying log. This patch makes orphan inodes cleanup executed after replaying log. It also avoid doing other unbound operations such as truncating a file during replaying log. These unbound operations are po

[PATCH 01/12] Btrfs: Avoid superfluous tree-log writeout

2009-11-12 Thread Yan, Zheng
We allow two log transactions at a time, but use same flag to mark dirty tree-log btree blocks. So we may flush dirty blocks belonging to newer log transaction when committing a log transaction. This patch fixes the issue by using two flags to mark dirty tree-log btree blocks. Signed-off-by: Yan Z

[PATCH 04/12] Btrfs: Fix disk_i_size update corner case

2009-11-12 Thread Yan, Zheng
There are some cases file extents are inserted without involving ordered struct. In these cases, we update disk_i_size directly, without checking pending ordered extent and DELALLOC bit. This patch extends btrfs_ordered_update_i_size() to handle these cases. Signed-off-by: Yan Zheng --- fs/btrfs

[PATCH 03/12] Btrfs: Rewrite btrfs_drop_extents

2009-11-12 Thread Yan, Zheng
Rewrite btrfs_drop_extents by using btrfs_duplicate_item, so we can avoid calling lock_extent within transaction. Signed-off-by: Yan Zheng --- fs/btrfs/ctree.h|7 +- fs/btrfs/file.c | 659 --- fs/btrfs/inode.c| 27 +-- fs/btrfs/i

[PATCH 02/12] Btrfs: Add btrfs_duplicate_item

2009-11-12 Thread Yan, Zheng
btrfs_duplicate_item duplicates item with new key, guaranteeing the source item and the new items are in the same tree leaf and contiguous. It allows us to split file extent in place, without using lock_extent to prevent bookend extent race. Signed-off-by: Yan Zheng --- fs/btrfs/ctree.c | 198 +