

---

 lxc-dave/fs/nfsd/vfs.c               |    2 +-
 lxc-dave/include/linux/nfsd/export.h |    7 ++++++-
 2 files changed, 7 insertions(+), 2 deletions(-)

diff -puN include/linux/nfsd/export.h~nfs-EX_RDONLY-for-bind-mounts include/linux/nfsd/export.h
--- lxc/include/linux/nfsd/export.h~nfs-EX_RDONLY-for-bind-mounts	2006-06-01 09:52:16.000000000 -0700
+++ lxc-dave/include/linux/nfsd/export.h	2006-06-01 09:54:11.000000000 -0700
@@ -73,10 +73,15 @@ struct svc_expkey {
 
 #define EX_SECURE(exp)		(!((exp)->ex_flags & NFSEXP_INSECURE_PORT))
 #define EX_ISSYNC(exp)		(!((exp)->ex_flags & NFSEXP_ASYNC))
-#define EX_RDONLY(exp)		((exp)->ex_flags & NFSEXP_READONLY)
 #define EX_NOHIDE(exp)		((exp)->ex_flags & NFSEXP_NOHIDE)
 #define EX_WGATHER(exp)		((exp)->ex_flags & NFSEXP_GATHERED_WRITES)
 
+static inline ex_rdonly(struct svc_export *exp)
+{
+	return (exp->ex_flags & NFSEXP_READONLY) ||
+		mnt_is_readonly(svc->ex_mnt);
+}
+
 
 /*
  * Function declarations
diff -puN fs/nfsd/vfs.c~nfs-EX_RDONLY-for-bind-mounts fs/nfsd/vfs.c
--- lxc/fs/nfsd/vfs.c~nfs-EX_RDONLY-for-bind-mounts	2006-06-01 09:53:42.000000000 -0700
+++ lxc-dave/fs/nfsd/vfs.c	2006-06-01 09:54:14.000000000 -0700
@@ -1777,7 +1777,7 @@ nfsd_permission(struct svc_export *exp, 
 	 */
 	if (!(acc & MAY_LOCAL_ACCESS))
 		if (acc & (MAY_WRITE | MAY_SATTR | MAY_TRUNC)) {
-			if (EX_RDONLY(exp) || IS_RDONLY(inode))
+			if (ex_rdonly(exp) || IS_RDONLY(inode))
 				return nfserr_rofs;
 			if (/* (acc & MAY_WRITE) && */ IS_IMMUTABLE(inode))
 				return nfserr_perm;
_
