]> git.proxmox.com Git - mirror_zfs.git/commit - cmd/zfs/zfs_main.c
Fix for re-reading /etc/mtab.
authorJohn M. Layman <jml@frijid.net>
Wed, 26 Mar 2014 17:17:17 +0000 (13:17 -0400)
committerBrian Behlendorf <behlendorf1@llnl.gov>
Fri, 4 Apr 2014 16:46:20 +0000 (09:46 -0700)
commitcbca6076b33e3d1af330e0e1f00cbf1baaf26d82
tree30c041bd7cea206aeac962f4cd48d4b264663b18
parentf3ad9cd67ae57760a7ec9e8cdb0e33aa8bbea4d0
Fix for re-reading /etc/mtab.

This is a continuation of fb5c53ea65b75c67c23f90ebbbb1134a5bb6c140:

    When /etc/mtab is updated on Linux it's done atomically with
    rename(2).  A new mtab is written, the existing mtab is unlinked,
    and the new mtab is renamed to /etc/mtab.  This means that we
    must close the old file and open the new file to get the updated
    contents.  Using rewind(3) will just move the file pointer back
    to the start of the file, freopen(3) will close and open the file.

In this commit, a few more rewind(3) calls were replaced with freopen(3)
to allow updated mtab entries to be picked up immediately.

Signed-off-by: John M. Layman <jml@frijid.net>
Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
Closes #2215
Issue #1611
cmd/zfs/zfs_main.c
lib/libzfs/libzfs_mount.c
lib/libzfs/libzfs_util.c