On Sun, 18 Nov 2012, Edward Tomasz Napierala wrote: > Author: trasz > Date: Sun Nov 18 19:01:00 2012 > New Revision: 243246 > URL: http://svnweb.freebsd.org/changeset/base/243246 > > Log: > Make it possible to resize filesystems mounted read-write, using newly > introduced UFS write suspension mechanism. > > Modified: head/sbin/growfs/growfs.c > ============================================================================== > --- head/sbin/growfs/growfs.c Sun Nov 18 18:57:19 2012 (r243245) > +++ head/sbin/growfs/growfs.c Sun Nov 18 19:01:00 2012 (r243246) > @@ -1555,9 +1557,18 @@ main(int argc, char **argv) > if (Nflag) { > fso = -1; > } else { > - fso = open(device, O_WRONLY); > - if (fso < 0) > - err(1, "%s", device); > + if (statfsp != NULL && (statfsp->f_flags & MNT_RDONLY) == 0) { > + fso = open(_PATH_UFSSUSPEND, O_RDWR); > + if (fso == -1) > + err(1, "unable to open %s", _PATH_UFSSUSPEND); > + error = ioctl(fso, UFSSUSPEND, &statfsp->f_fsid); > + if (error != 0) > + err(1, "UFSSUSPEND"); > + } else { > + fso = open(device, O_WRONLY); > + if (fso < 0) > + err(1, "%s", device); > + } > }
It is excellent to see this functionality, and it will be very much appreciated especially for people using virtual machines. All the way through later code there are calls to err() on failure. What happens to the suspended filesystem if that happens and growfs exits before the matching UFSRESUME? Thanks, Gavin _______________________________________________ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"