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>
Tue, 11 Nov 2014 02:34:52 +0000 (21:34 -0500)
commit8e45f1750d8928b3bc79a43cedb04a56a0043a46
tree30517dca5d44a2035008fd0023de4ad2902160f1
parent023739bc3df3819a11c32184fa71c458381b9f98
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