Unionfs: bugfix when mounting readonly exported NFS volumes (was: nfsro)
authorErez_Zadok <ezk@cs.sunysb.edu>
Thu, 26 Jul 2007 04:04:58 +0000 (00:04 -0400)
committerErez Zadok <ezk@cs.sunysb.edu>
Fri, 22 Nov 2013 23:53:42 +0000 (18:53 -0500)
commit64c30f8677f7ba3c301f705dd2f41a9e6b51d419
tree5a4ac7f9aafd15bf55749a4abdc21b0c21c42675
parenta40341b74523f5d36d11c0349d4a5e5703a71036
Unionfs: bugfix when mounting readonly exported NFS volumes (was: nfsro)

When stacking on top of readonly exported NFS volumes, which are mounted
locally read-write, attempting to create a new file yields the proper EROFS.
But attempting to modify an existing file returns an EACCES, which
interferes with unionfs's copyup policy: only EROFS triggers a copyup,
whereas EACCES does not (and shouldn't -- that'd be a security hole).  The
old unionfs 1.x attempted to workaround this EACCES condition by supporting
a special unionfs mount option called 'nfsro'; support for this option was
left in the latest unionfs 2.0, but the mount option was not made available
until we could properly investigate this issue with the latest NFS code.

This patch removes all remnants of this 'nfsro' support.  It is no longer
needed.  Instead, users can use the existing per-branch 'ro' unionfs mount
option, which would properly return the appropriate status conditions back
from unionfs_permission.  These return conditions result in a copyup if and
only if needed, even for readonly exported NFS volumes.  In effect, unionfs
per-branch 'ro' option now simulates a true readonly localhost mount.

Signed-off-by: Erez Zadok <ezk@cs.sunysb.edu>
fs/unionfs/inode.c
include/linux/union_fs.h