zfsonlinux/zfs — pull request #1651 by jmlayman (2013-08-13 19:41:01+00:00)
Title: Issue 1611: Fix for re-reading /etc/mtab in zfs_is_mounted().

Hi - as requested, here is a fix for the problem with /etc/mtab not being re-read in zfs_is_mounted() (issue #1611). I added error checking on the newly added freopen() calls, but what to do in case of error wasn't obvious. Looking at the surrounding code, it looks like returning ENOENT is the model so I chose to do the same. Another option would be to return errno instead of ENOENT. Note that this required me to change the return type of libzfs_mnttab_update() from void to int, but since that function is local to libzfs_dataset.c this shouldn't be a problem.

Let me know if you have any questions/concerns.