Re: overlayfs: mounting overlayfs on top of overlayfs

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hello,

The attached patch solves the problem,

Thanks,

Jordi Pujol

Live never ending Tale
GNU/Linux Live forever!
http://livenet.selfip.com
 overlayfs v10:
 - Test for readonly using the vfsmount superblock
  from the main filesystem.
 - Ignore WRITE request for the real filesystems.

Signed-off-by: Jordi Pujol <jordipujolp@xxxxxxxxx>

--- a/fs/overlayfs/inode.c
+++ b/fs/overlayfs/inode.c	2011-06-05 10:06:25.323823937 +0200
@@ -54,6 +54,9 @@ int ovl_permission(struct inode *inode,
 	bool is_upper;
 	int err;

+	if (mask & MAY_WRITE && IS_RDONLY(inode))
+		return -EROFS;
+
 	if (S_ISDIR(inode->i_mode)) {
 		oe = inode->i_private;
 	} else if (flags & IPERM_FLAG_RCU) {
@@ -102,6 +105,8 @@ int ovl_permission(struct inode *inode,
 		err = -EACCES;
 		if (IS_IMMUTABLE(realinode))
 			goto out_dput;
+
+		mask &= ~MAY_WRITE;
 	}

 	if (realinode->i_op->permission)

[Index of Archives]     [Linux Ext4 Filesystem]     [Union Filesystem]     [Filesystem Testing]     [Ceph Users]     [Ecryptfs]     [AutoFS]     [Kernel Newbies]     [Share Photos]     [Security]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux Cachefs]     [Reiser Filesystem]     [Linux RAID]     [Samba]     [Device Mapper]     [CEPH Development]
  Powered by Linux