Date: Wed, 22 May 1996 11:58:15 -0500 From: Randy Terbush <randy@zyzzyva.com> To: freebsd-hackers@freebsd.org Subject: mount() flags Message-ID: <199605221658.LAA01473@sierra.zyzzyva.com>
next in thread | raw e-mail | index | archive | help
Could someone offer some feedback about the following scenario, and perhaps some clues about the flags MNT_UPDATE and MNT_RELOAD? These flags aren't mentioned in the manpage. I have the following snippet of code. What I am trying to do is change a read-only mounted filesystem to read-write, change something on the filesystem, then remount read-only. This seems to cause a system panic, (details currently unavailable). Trying to duplicate the problem with a floppy device I am finding that it looks as though these types of requests don't get queued. It would also appear that I may be in for a challenge to figure out how to wait for the first to finish. Suggestions for the clueless are welcome. In the case below, the second call to mount will fail since the first call is still in progress. Is there a way to wait() on the first call? main () { struct ufs_args *ufs; ufs = (struct ufs_args *) malloc (sizeof (struct ufs_args)); ufs->fspec = "/dev/fd0a"; if ((mount (MOUNT_UFS, "/mnt", MNT_UPDATE, ufs)) != 0) { fprintf (stderr, "failed to change mount status\n"); perror ("mount"); } exec something here..... if ((mount (MOUNT_UFS, "/mnt", MNT_RDONLY, ufs)) != 0) { fprintf (stderr, "failed to change mount status\n"); perror ("mount"); } }
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199605221658.LAA01473>