Is there any way to mark existing snapshots as read-only? Making new ones read-only is easy enough, but what about existing ones? Thanks. -- Bruce Guenter <bruce@untroubled.org> http://untroubled.org/
On 2012/5/29 2:37, Bruce Guenter wrote:> > Is there any way to mark existing snapshots as read-only? Making new > ones read-only is easy enough, but what about existing ones? >We have code in the kernel side, so what we need to do is to update btrfs-progs, which is trivial. -- To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
On Tue, May 29, 2012 at 08:40:10AM +0800, Li Zefan wrote:> > Is there any way to mark existing snapshots as read-only? Making new > > ones read-only is easy enough, but what about existing ones? > > We have code in the kernel side, so what we need to do is to update btrfs-progs, > which is trivial.Well, I don''t like that it''s even possible to turn a RO snapshot to a RW one. What was the rationale behind this back then? Besides, I think that it could break assumptions in the backref code. If it''s only a one-way operation from a regular subvol -> RO subvol, this sounds reasonable to me. If the opposite direction is allowed, then I''d not call it ''read-only'' but "unwritable on-request". david -- To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
On Tue, May 29, 2012 at 5:18 AM, David Sterba <dave@jikos.cz> wrote:> On Tue, May 29, 2012 at 08:40:10AM +0800, Li Zefan wrote: >> > Is there any way to mark existing snapshots as read-only? Making new >> > ones read-only is easy enough, but what about existing ones? >> >> We have code in the kernel side, so what we need to do is to update btrfs-progs, >> which is trivial. > > Well, I don''t like that it''s even possible to turn a RO snapshot to a RW > one. What was the rationale behind this back then? Besides, I think that > it could break assumptions in the backref code. > > If it''s only a one-way operation from a regular subvol -> RO subvol, > this sounds reasonable to me. If the opposite direction is allowed, then > I''d not call it ''read-only'' but "unwritable on-request".Is anyone actually expecting readonly-snapshots to be a worm implementation? And are they sane to expect it? So long as the permissions required to change it are sane (admin rights to change an arbitrary snapshot, possibly something like write-permission on the mountpoint to change otherwise), I don''t see the gain. It''s not like root can''t modify the disk directly, so withholding an easy way to flip the readonly bit just strikes me as a nuisance feature. -- To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
2012-05-28 12:37:00 -0600, Bruce Guenter:> > Is there any way to mark existing snapshots as read-only? Making new > ones read-only is easy enough, but what about existing ones?[...] you can always do btrfs sub snap -r vol vol-ro btrfs sub del vol mv vol-ro vol -- Stephane -- To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html