Re: writing to RW-mounted UFS2 snapshots - confirmed.

From: John Kozubik (john_at_kozubik.com)
Date: 07/02/04

  • Next message: Eitarou Kamo: "Re: FreeBSD and MacOS"
    Date: Thu, 1 Jul 2004 18:16:50 -0700 (PDT)
    To: freebsd-hackers@freebsd.org
    
    

    On Thu, 1 Jul 2004, Q wrote:

    > > While this may not be "expected" behavior, I am curious why this is
    > > something that should be prevented, rather than verified for
    > > correctness? By "correct" I mean, that the copy on write process is
    > > performed correctly and modifications made to the snapshot don't
    > > modify the underlying filesystem elements also.
    >
    > Ok, I decided to be self sufficient and read Marshall McKusick's paper
    > on background fsck (which also covers snapshots) to answer my own
    > question.
    >
    > Firstly, one of the stated requirements for snapshots to function as
    > outlined in the paper is that they must be read only. The reason they
    > need to be read only is because the support for multiple snapshots
    > assumes that they cannot change, and handles block allocation of freed
    > blocks with this in mind. Supporting snapshot modification is outside
    > the scope of the original implementation and would require further
    > thought.

    This was the main reason that I decided to go back and see if this was
    really happening or not. I read the USENIX paper (McKusick) to be quite
    clear that snapshots must be read-only: "Writes to snapshot files are not
    permitted". However, nothing is said about writing files to, or changing
    files within, a mounted snapshot file.

    My initial assumption is that both activities are equally incorrect (and
    dangerous - especially for subsequent snapshots created after altering the
    first one).

    As for a solution, I suppose a quick fix would be to alter `mount` to
    disallow the read/write mount of a snapshot file. This is similar to the
    exception that is already coded into `unlink` to accomodate snapshot
    files.

    I just submitted a PR for this.

    -----
    John Kozubik - john@kozubik.com - http://www.kozubik.com

    _______________________________________________
    freebsd-hackers@freebsd.org mailing list
    http://lists.freebsd.org/mailman/listinfo/freebsd-hackers
    To unsubscribe, send any mail to "freebsd-hackers-unsubscribe@freebsd.org"


  • Next message: Eitarou Kamo: "Re: FreeBSD and MacOS"

    Relevant Pages

    • Re: Compressed Snapshot Files!!!
      ... uncheck the generate snapshot in the default folder location for your ... You gave solution for Pull Subscription But We are ... > "Hilary Cotter" wrote in message ... I have compress snapshot file now ...
      (microsoft.public.sqlserver.replication)
    • Re: backup strategies
      ... >>dump(8) will create a snapshot of a live filesystem, ... The real magic is in the snapshot file. ...
      (freebsd-questions)
    • Re: How do I insert a preview of a SnapShot in PowerPoint?
      ... What I have read on snapshot files ... You could put your snapshot file into MSWord. ... | and paste it as a WMF file into PowerPoint. ... but then I only get the Icon ...
      (microsoft.public.powerpoint)
    • RE: Snapshot failure
      ... I'm trying to create the snapshot file on the same drive and directory the ... backend is located on, so I have to presume I have the rights. ... if I run the master front end from the network drive it's located ...
      (microsoft.public.access.modulesdaovba)