Skip to content

Commit

Permalink
Disable zfs /etc/mtab updates
Browse files Browse the repository at this point in the history
Completely disable the zfs binary from attempting to directly update
/etc/mtab.  The Linux port relies entirely on the mount.zfs helper
to safely update /etc/mtab.  If we left the /etc/mtab updates to
the zfs binary then they could race with concurrent non-zfs mounts.
Routing everything through the system mount command ensures the
/etc/mtab updates are locked properly.

Signed-off-by: Brian Behlendorf <[email protected]>
Issue openzfs#329
  • Loading branch information
behlendorf committed Aug 19, 2011
1 parent ddd052a commit b740d60
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions cmd/zfs/zfs_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -6177,7 +6177,7 @@ main(int argc, char **argv)
/*
* Run the appropriate command.
*/
libzfs_mnttab_cache(g_zfs, B_TRUE);
libzfs_mnttab_cache(g_zfs, B_FALSE);
if (find_command_idx(cmdname, &i) == 0) {
current_command = &command_table[i];
ret = command_table[i].func(argc - 1, argv + 1);
Expand All @@ -6191,7 +6191,6 @@ main(int argc, char **argv)
usage(B_FALSE);
ret = 1;
}
libzfs_mnttab_cache(g_zfs, B_FALSE);
libzfs_fini(g_zfs);

(void) fclose(mnttab_file);
Expand Down

0 comments on commit b740d60

Please sign in to comment.