Re: flushing disk buffer cache

From: Don Lewis (truckman_at_FreeBSD.org)
Date: 10/29/04

  • Next message: Nguyen Tam Chinh: "Re: ad0: FAILURE - WRITE_DMA"
    Date: Fri, 29 Oct 2004 12:56:08 -0700 (PDT)
    To: saggarwa@cs.utah.edu
    
    

    On 29 Oct, Siddharth Aggarwal wrote:
    >
    > Thanks for your reply.
    >
    > Hmm. At the moment, the user can send an ioctl to define a checkpoint. But
    > I would guess that this could happen between 2 strategy() function calls
    > corresponding to the same filesystem operation?

    Yes.

    > So if there a way to block
    > filesystem operations while a snapshot is taken? I can't unmount an active
    > filesystem before the snapshot and remount it after. Any suggestions?

    Yes, this is done by the following code in ffs_snapshot():

            /*
             * Suspend operation on filesystem.
             */
            for (;;) {
                    vn_finished_write(wrtmp);
                    if ((error = vfs_write_suspend(vp->v_mount)) != 0) {
                            vn_start_write(NULL, &wrtmp, V_WAIT);
                            vn_lock(vp, LK_EXCLUSIVE | LK_RETRY, td);
                            goto out;
                    }
                    if (mp->mnt_kern_flag & MNTK_SUSPENDED)
                            break;
                    vn_start_write(NULL, &wrtmp, V_WAIT);
            }

    I think the snapshot code works at a higher level than what you are
    implementing, so I believe that the snapshot code doesn't need to sync
    all the files to create a consistent snapshot. You may run into
    problems with syncing unwritten data while writing is suspended, but I'm
    not sure because don't understand the code all that well.
    _______________________________________________
    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: Nguyen Tam Chinh: "Re: ad0: FAILURE - WRITE_DMA"

    Relevant Pages

    • Re: mksnap_ffs woes
      ... > Kris Kennaway wrote: ... It's possible you're seeing deadlock bugs in the snapshot code; ... written as a general-purpose live filesystem snapshot service. ...
      (freebsd-questions)
    • Re: The ext3 way of journalling
      ... software failure using snapshots. ... Having said that, I have *no* idea what state the snapshot code is in, but I ...
      (Linux-Kernel)
    • inconstistent snapshot contents
      ... during regularly backups with tar from a filesystem snapshot ... I noticed that the contents of the snapshot changed during the ... Is there any bug known with the snapshot code? ...
      (freebsd-questions)