linux-btrfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/5] btrfs: Readonly snapshots
@ 2010-11-29  8:02 Li Zefan
  2010-11-29  8:02 ` [PATCH 1/5] btrfs: Make async snapshot ioctl more generic Li Zefan
                   ` (4 more replies)
  0 siblings, 5 replies; 14+ messages in thread
From: Li Zefan @ 2010-11-29  8:02 UTC (permalink / raw)
  To: linux-btrfs; +Cc: Sage Weil

(Cc: Sage Weil <sage@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 callbacks, as well as in some ioctls.

You can also try it out by pulling (based on the master branch of
Chris' tree):
	git://repo.or.cz/linux-btrfs-devel.git readonly-snapshots

Note: I changed the async snapshot ABI. So if the patchset is acceptable,
the first patch has to be merged into .37 to avoid ABI breakage.

---
 fs/btrfs/ctree.h       |    3 +
 fs/btrfs/disk-io.c     |   36 +++++++-----
 fs/btrfs/inode.c       |    8 +++
 fs/btrfs/ioctl.c       |  147 +++++++++++++++++++++++++++++++++++++++++-------
 fs/btrfs/ioctl.h       |   16 ++++-
 fs/btrfs/transaction.c |    8 +++
 fs/btrfs/transaction.h |    1 +
 fs/btrfs/xattr.c       |   18 ++++++
 8 files changed, 196 insertions(+), 41 deletions(-)

^ permalink raw reply	[flat|nested] 14+ messages in thread
* Re: [PATCH 1/5] btrfs: Make async snapshot ioctl more generic
@ 2010-11-29 19:11 Goffredo Baroncelli
  0 siblings, 0 replies; 14+ messages in thread
From: Goffredo Baroncelli @ 2010-11-29 19:11 UTC (permalink / raw)
  To: Li Zefan; +Cc: linux-btrfs

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
>         (flags^(BTRFS_SNAPSHOT_CREATE_ASYNC|BTRFS_SNAPSHOT_RDONLY)) == 0
> and
>         unused[0..3] == 0


Sorry, the check should be

(flags & (~(BTRFS_SNAPSHOT_CREATE_ASYNC|BTRFS_SNAPSHOT_RDONLY))) == 0
> 
> For future expansion I suggest to use a different ioctl. To me it seems a 
more 
> robust API.
> 


-- 
gpg key@ keyserver.linux.it: Goffredo Baroncelli (ghigo) <kreijack@inwind.it>
Key fingerprint = 4769 7E51 5293 D36C 814E  C054 BF04 F161 3DC5 0512

^ permalink raw reply	[flat|nested] 14+ messages in thread

end of thread, other threads:[~2010-12-08  1:09 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-11-29  8:02 [PATCH 0/5] btrfs: Readonly snapshots Li Zefan
2010-11-29  8:02 ` [PATCH 1/5] btrfs: Make async snapshot ioctl more generic Li Zefan
2010-11-29 18:52   ` Goffredo Baroncelli
2010-11-30  1:13     ` Li Zefan
2010-11-29 19:28   ` Sage Weil
2010-12-07 19:04   ` Sage Weil
2010-12-08  1:09     ` Li Zefan
2010-11-29  8:03 ` [PATCH 2/5] btrfs: Fix memory leak in a failure path Li Zefan
2010-11-29  8:03 ` [PATCH 3/5] btrfs: Add helper __setup_root_post() Li Zefan
2010-11-29  8:03 ` [PATCH 4/5] btrfs: Add readonly snapshots support Li Zefan
2010-11-29  8:03 ` [PATCH 5/5] btrfs: Add ioctl to set snapshot readonly/writable Li Zefan
2010-11-29 18:52   ` Goffredo Baroncelli
2010-11-30  7:03     ` Li Zefan
  -- strict thread matches above, loose matches on Subject: below --
2010-11-29 19:11 [PATCH 1/5] btrfs: Make async snapshot ioctl more generic Goffredo Baroncelli

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).