GIT: unionfs2-2.6.27.y: Unionfs: fix readonly nfs2/3 permission handling
Erez Zadok
ezk at fsl.cs.sunysb.edu
Thu Aug 12 23:18:14 EDT 2010
commit f9d2daab7e9b64792b3f095d52dce5d2833e3a3d
Author: Erez Zadok <ezk at cs.sunysb.edu>
Date: Tue Sep 22 17:35:15 2009 -0400
Unionfs: fix readonly nfs2/3 permission handling
In unionfs_permission: NFSv2/3 return EACCES on readonly-exported, locally
readonly-mounted file systems, instead of EROFS like other file systems do.
So we have no choice here but to intercept this and ignore it for NFS
branches marked readonly. Specifically, we avoid using NFS's own "broken"
->permission method, and rely on generic_permission() to do basic checking
for us.
Signed-off-by: Erez Zadok <ezk at cs.sunysb.edu>
diff --git a/fs/unionfs/inode.c b/fs/unionfs/inode.c
index 7c17093..7e86273 100644
--- a/fs/unionfs/inode.c
+++ b/fs/unionfs/inode.c
@@ -843,6 +843,20 @@ static int unionfs_permission(struct inode *inode, int mask)
}
/*
+ * NFS HACK: NFSv2/3 return EACCES on readonly-exported,
+ * locally readonly-mounted file systems, instead of EROFS
+ * like other file systems do. So we have no choice here
+ * but to intercept this and ignore it for NFS branches
+ * marked readonly. Specifically, we avoid using NFS's own
+ * "broken" ->permission method, and rely on
+ * generic_permission() to do basic checking for us.
+ */
+ if (err && err == -EACCES &&
+ is_robranch_super(inode->i_sb, bindex) &&
+ lower_inode->i_sb->s_magic == NFS_SUPER_MAGIC)
+ err = generic_permission(lower_inode, mask, NULL);
+
+ /*
* The permissions are an intersection of the overall directory
* permissions, so we fail if one fails.
*/
More information about the unionfs-cvs
mailing list