[PATCH 0/5] btrfs: Readonly snapshots

2010-11-29 Thread Li Zefan
(Cc: Sage Weil s...@newdream.net for changes in async snapshots) This patchset adds readonly-snapshots support. You can create a readonly snapshot, and you can also set a snapshot readonly/writable on the fly. A few readonly checks are added in setattr, permission, remove_xattr and set_xattr

[PATCH 1/5] btrfs: Make async snapshot ioctl more generic

2010-11-29 Thread Li Zefan
So we don't have to add new structures as we create more ioctls for snapshots. Now to create async snapshot, set BTRFS_SNAPSHOT_CREATE_ASYNC bit of vol_arg_v2-flags, and then call ioctl(BTRFS_IOCT_SNAP_CREATE_V2). Note: this changes the async snapshot ioctl ABI, which was merged in .37 merge

[PATCH 2/5] btrfs: Fix memory leak in a failure path

2010-11-29 Thread Li Zefan
In btrfs_ioctl_snap_create(), vol_args_v2 is not freed if copy_to_user() returns failure. Signed-off-by: Li Zefan l...@cn.fujitsu.com --- fs/btrfs/ioctl.c |2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/fs/btrfs/ioctl.c b/fs/btrfs/ioctl.c index d3f1a60..ba437ad 100644

[PATCH 3/5] btrfs: Add helper __setup_root_post()

2010-11-29 Thread Li Zefan
This eliminates duplicate code in find_and_setup_root() and btrfs_read_fs_root_no_radix(). (Prepare for the next patch) Signed-off-by: Li Zefan l...@cn.fujitsu.com --- fs/btrfs/disk-io.c | 31 +++ 1 files changed, 15 insertions(+), 16 deletions(-) diff --git

[PATCH 4/5] btrfs: Add readonly snapshots support

2010-11-29 Thread Li Zefan
Usage: Set BTRFS_SNAPSHOT_CREATE_RDONLY of btrfs_ioctl_vol_arg_v2-flags, and call ioctl(BTRFS_I0CTL_SNAP_CREATE_V2). Implementation: - In disk set readonly bit of btrfs_root_item-flags, and in memory set btrfs_root-readonly. - Add readonly checks in btrfs_permission (inode_permission),

[PATCH 5/5] btrfs: Add ioctl to set snapshot readonly/writable

2010-11-29 Thread Li Zefan
This allows us to set a snapshot readonly or writable on the fly. Usage: Set BTRFS_SNAPSHOT_RDONLY/WRITABLE of btrfs_ioctl_vol_arg_v2-flags, and then call ioctl(BTRFS_IOCTL_SNAP_SETFLAGS); Signed-off-by: Li Zefan l...@cn.fujitsu.com --- fs/btrfs/ioctl.c | 88

Re: [next-rc] Compile Error fs/btrfs/diskio.c

2010-11-29 Thread Chris Mason
Excerpts from Mitch Harder's message of 2010-11-27 17:53:23 -0500: I've been getting a compile error when building the 'next-rc' branch of btrfs-unstable. CC fs/btrfs/disk-io.o fs/btrfs/disk-io.c: In function ‘btree_migratepage’: fs/btrfs/disk-io.c:716: error: called object ‘0u’ is

[GIT PULL] Btrfs updates for 2.6.37-rc

2010-11-29 Thread Chris Mason
Hi everyone, The master branch of the btrfs unstable tree: git://git.kernel.org/pub/scm/linux/kernel/git/mason/btrfs-unstable.git master Has a collection of btrfs bug fixes. The three most important fixes here address crashes in the btrfs O_DIRECT code, add a migrate_page operation to avoid

Re: [RFC-PATCH] Re: mounting arbitrary directories

2010-11-29 Thread C Anthony Risinger
On Sun, Nov 28, 2010 at 4:07 AM, C Anthony Risinger anth...@extof.me wrote: On Nov 27, 2010, at 10:22 PM, Calvin Walton calvin.wal...@gmail.com wrote: On Sat, 2010-11-27 at 21:19 -0600, C Anthony Risinger wrote: eg. if i have a regular directory (not a subvolume) in the top- level: /__boot

Re: [GIT PULL][PATCH v2 0/6] btrfs: Add lzo compression support

2010-11-29 Thread C Anthony Risinger
On Wed, Nov 17, 2010 at 8:08 PM, Li Zefan l...@cn.fujitsu.com wrote: Hi Chris, Here's the updated patchset. As I still haven't got a kernel.org account, I have set up a git tree in another public git repository, and I'll use it for now. You can pull from:        

Re: Root fs on raid1

2010-11-29 Thread Goffredo Baroncelli
On Monday, 29 November, 2010, you (Erik Jensen) wrote: I have a similar setup on one of my computers. I set it up a while ago using an initramfs, but I could not get the device scan to work properly, for whatever reason. I ended up having it just trying to mount every device in the array in

Re: [PATCH 1/5] btrfs: Make async snapshot ioctl more generic

2010-11-29 Thread Goffredo Baroncelli
Hi Li, great work, but I have some suggestions: On Monday, 29 November, 2010, Li Zefan wrote: So we don't have to add new structures as we create more ioctls for snapshots. Now to create async snapshot, set BTRFS_SNAPSHOT_CREATE_ASYNC bit of vol_arg_v2-flags, and then call

Re: [PATCH 5/5] btrfs: Add ioctl to set snapshot readonly/writable

2010-11-29 Thread Goffredo Baroncelli
Hi Li, On Monday, 29 November, 2010, Li Zefan wrote: This allows us to set a snapshot readonly or writable on the fly. Usage: Set BTRFS_SNAPSHOT_RDONLY/WRITABLE of btrfs_ioctl_vol_arg_v2-flags, and then call ioctl(BTRFS_IOCTL_SNAP_SETFLAGS); I really appreciate your work, but I have some

Re: [PATCH 1/5] btrfs: Make async snapshot ioctl more generic

2010-11-29 Thread Goffredo Baroncelli
On Monday, 29 November, 2010, Goffredo Baroncelli wrote: Why the unused fields ? What happens if you use a more recent btrfs-tools which take advantage of these fields but the kernel is an old one ? At the minimum please check the flags so

Re: [PATCH 1/5] btrfs: Make async snapshot ioctl more generic

2010-11-29 Thread Sage Weil
Hi Li, On Mon, 29 Nov 2010, Li Zefan wrote: So we don't have to add new structures as we create more ioctls for snapshots. Now to create async snapshot, set BTRFS_SNAPSHOT_CREATE_ASYNC bit of vol_arg_v2-flags, and then call ioctl(BTRFS_IOCT_SNAP_CREATE_V2). Note: this changes the async

Default to read-only on snapshot creation and have a flag if snapshot should be writable (was: [PATCH 0/5] btrfs: Readonly snapshots)

2010-11-29 Thread Mike Fedyk
On Mon, Nov 29, 2010 at 12:02 AM, Li Zefan l...@cn.fujitsu.com wrote: (Cc: Sage Weil s...@newdream.net for changes in async snapshots) This patchset adds readonly-snapshots support. You can create a readonly snapshot, and you can also set a snapshot readonly/writable on the fly. A few

Re: [RFC PATCH 0/4] Add readonly support to replace BUG_ON phrase

2010-11-29 Thread Josef Bacik
On Thu, Nov 25, 2010 at 05:52:47PM +0800, Miao Xie wrote: Btrfs has a number of BUG_ON()s, which may lead btrfs to unpleasant panic. Meanwhile, they are very ugly and should be handled more propriately. There are mainly two ways to deal with these BUG_ON()s. 1. For those errors which can

Re: Default to read-only on snapshot creation and have a flag if snapshot should be writable (was: [PATCH 0/5] btrfs: Readonly snapshots)

2010-11-29 Thread David Arendt
On 11/29/10 21:02, Mike Fedyk wrote: On Mon, Nov 29, 2010 at 12:02 AM, Li Zefanl...@cn.fujitsu.com wrote: (Cc: Sage Weils...@newdream.net for changes in async snapshots) This patchset adds readonly-snapshots support. You can create a readonly snapshot, and you can also set a snapshot

Errors during defragmentation

2010-11-29 Thread Andrej Podzimek
Hello, I decided to test the 'defragment' feature on my system (after a huge number of system updates and prelinking): find /bin /sbin /lib /usr/lib /usr/bin /usr/sbin -type d -exec btrfs filesystem defragment '{}' '+' I have already defragmented a couple of (very large) directories

Re: Default to read-only on snapshot creation and have a flag if snapshot should be writable (was: [PATCH 0/5] btrfs: Readonly snapshots)

2010-11-29 Thread Mike Fedyk
On Mon, Nov 29, 2010 at 12:41 PM, David Arendt ad...@prnet.org wrote: On 11/29/10 21:02, Mike Fedyk wrote: On Mon, Nov 29, 2010 at 12:02 AM, Li Zefanl...@cn.fujitsu.com  wrote: (Cc: Sage Weils...@newdream.net  for changes in async snapshots) This patchset adds readonly-snapshots support.

Re: [RFC PATCH 0/4] Add readonly support to replace BUG_ON phrase

2010-11-29 Thread Mike Fedyk
On Mon, Nov 29, 2010 at 12:10 PM, Josef Bacik jo...@redhat.com wrote: On Thu, Nov 25, 2010 at 05:52:47PM +0800, Miao Xie wrote: Btrfs has a number of BUG_ON()s, which may lead btrfs to unpleasant panic. Meanwhile, they are very ugly and should be handled more propriately. There are mainly two

Re: Errors during defragmentation

2010-11-29 Thread Hugo Mills
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On Mon, Nov 29, 2010 at 10:02:56PM +0100, Andrej Podzimek wrote: Hello, I decided to test the 'defragment' feature on my system (after a huge number of system updates and prelinking): find /bin /sbin /lib /usr/lib /usr/bin /usr/sbin

Re: Default to read-only on snapshot creation and have a flag if snapshot should be writable (was: [PATCH 0/5] btrfs: Readonly snapshots)

2010-11-29 Thread Andrey Kuzmin
This may sound excessive as any new concept introduction that late in development, but readonly/writable snapshots could be further differentiated by naming the latter clones. This way end-user would naturally perceive snapsot as read-only PIT fs image, while clone would naturally refer to

Re: Default to read-only on snapshot creation and have a flag if snapshot should be writable (was: [PATCH 0/5] btrfs: Readonly snapshots)

2010-11-29 Thread Mike Fedyk
On Mon, Nov 29, 2010 at 1:31 PM, Andrey Kuzmin andrey.v.kuz...@gmail.com wrote: This may sound excessive as any new concept introduction that late in development, but readonly/writable snapshots could be further differentiated by naming the latter clones. This way end-user would naturally

Re: Errors during defragmentation

2010-11-29 Thread Andrej Podzimek
Hello, I decided to test the 'defragment' feature on my system (after a huge number of system updates and prelinking): find /bin /sbin /lib /usr/lib /usr/bin /usr/sbin -type d -exec btrfs filesystem defragment '{}' '+' I have already defragmented a couple of (very large) directories

Re: [patch] fs: fix deadlocks in writeback_if_idle

2010-11-29 Thread Andrew Morton
On Thu, 25 Nov 2010 14:53:56 +1100 Nick Piggin npig...@kernel.dk wrote: On Wed, Nov 24, 2010 at 02:10:28PM +0100, Jan Kara wrote: On Wed 24-11-10 12:03:43, Nick Piggin wrote: For the _nr variant that btrfs uses, it's worse for the filesystems that don't have a 1:1 bdi-sb

Re: [patch] fs: fix deadlocks in writeback_if_idle

2010-11-29 Thread Nick Piggin
On Mon, Nov 29, 2010 at 02:26:03PM -0800, Andrew Morton wrote: On Thu, 25 Nov 2010 14:53:56 +1100 Nick Piggin npig...@kernel.dk wrote: On Wed, Nov 24, 2010 at 02:10:28PM +0100, Jan Kara wrote: Well, for now, the easiest and simplest fix is my patch, I think. The objection is that we

Re: Default to read-only on snapshot creation and have a flag if snapshot should be writable (was: [PATCH 0/5] btrfs: Readonly snapshots)

2010-11-29 Thread C Anthony Risinger
On Nov 29, 2010, at 3:48 PM, Andrey Kuzmin andrey.v.kuz...@gmail.com wrote: I'm not sure why zfs came up, they don't own the term :). As to zfs/overhead topic, I doubt there's any difference between clone and writable shapshot (there should be none, of course, it's just two different names

Re: [PATCH 1/5] btrfs: Make async snapshot ioctl more generic

2010-11-29 Thread Li Zefan
Goffredo Baroncelli wrote: Hi Li, great work, but I have some suggestions: On Monday, 29 November, 2010, Li Zefan wrote: So we don't have to add new structures as we create more ioctls for snapshots. Now to create async snapshot, set BTRFS_SNAPSHOT_CREATE_ASYNC bit of vol_arg_v2-flags,

Re: [RFC PATCH 0/4] Add readonly support to replace BUG_ON phrase

2010-11-29 Thread liubo
On 11/30/2010 04:10 AM, Josef Bacik wrote: On Thu, Nov 25, 2010 at 05:52:47PM +0800, Miao Xie wrote: Btrfs has a number of BUG_ON()s, which may lead btrfs to unpleasant panic. Meanwhile, they are very ugly and should be handled more propriately. There are mainly two ways to deal with these

Re: Default to read-only on snapshot creation and have a flag if snapshot should be writable (was: [PATCH 0/5] btrfs: Readonly snapshots)

2010-11-29 Thread Li Zefan
C Anthony Risinger wrote: On Nov 29, 2010, at 3:48 PM, Andrey Kuzmin andrey.v.kuz...@gmail.com wrote: I'm not sure why zfs came up, they don't own the term :). As to zfs/overhead topic, I doubt there's any difference between clone and writable shapshot (there should be none, of course, it's

Re: [RFC PATCH 0/4] Add readonly support to replace BUG_ON phrase

2010-11-29 Thread Josef Bacik
On Tue, Nov 30, 2010 at 10:03:58AM +0800, liubo wrote: On 11/30/2010 04:10 AM, Josef Bacik wrote: On Thu, Nov 25, 2010 at 05:52:47PM +0800, Miao Xie wrote: Btrfs has a number of BUG_ON()s, which may lead btrfs to unpleasant panic. Meanwhile, they are very ugly and should be handled more

Re: [RFC PATCH 0/4] Add readonly support to replace BUG_ON phrase

2010-11-29 Thread liubo
On 11/30/2010 10:30 AM, Josef Bacik wrote: On Tue, Nov 30, 2010 at 10:03:58AM +0800, liubo wrote: On 11/30/2010 04:10 AM, Josef Bacik wrote: On Thu, Nov 25, 2010 at 05:52:47PM +0800, Miao Xie wrote: Btrfs has a number of BUG_ON()s, which may lead btrfs to unpleasant panic. Meanwhile, they are

R: Re: [PATCH 5/5] btrfs: Add ioctl to set snapshot readonly/writable

2010-11-29 Thread Goffredo Baroncelli kreij...@libero.it
Hi Li, Messaggio originale Da: l...@cn.fujitsu.com Data: 30/11/2010 8.03 A: kreij...@libero.it Cc: linux-btrfs@vger.kernel.org Ogg: Re: [PATCH 5/5] btrfs: Add ioctl to set snapshot readonly/writable Goffredo Baroncelli wrote: Hi Li, On Monday, 29 November, 2010, Li Zefan wrote: This