Cow fix for 2.6.32+
Sapan Bhatia [Tue, 31 May 2011 04:43:46 +0000 (00:43 -0400)]
kernel-2.6.spec
linux-2.6-255-vserver-delta-cow-fix23.diff [new file with mode: 0644]

index fd3a70f..53fa2f3 100644 (file)
@@ -668,6 +668,7 @@ Source82: config-s390x-debug
 Source83: config-s390x-debug-rhel
 
 Patch1: patch-2.6.32-71.24.1.el6-vs2.3.0.36.29.6.diff
+Patch2: linux-2.6-255-vserver-delta-cow-fix23.diff
 Patch3: linux-2.6-250-ipsets.patch
 Patch4: linux-2.6-510-ipod.patch
 Patch5: linux-2.6-521-packet-tagging.patch
@@ -964,6 +965,7 @@ make -f %{SOURCE20} VERSION=%{version} configs
 #### Planet-Lab ####
 ApplyPatch patch-2.6.32-71.24.1.el6-vs2.3.0.36.29.6.diff
 ApplyPatch linux-2.6-250-ipsets.patch
+ApplyPatch linux-2.6-255-vserver-delta-cow-fix23.diff
 ApplyPatch linux-2.6-510-ipod.patch
 ApplyPatch linux-2.6-521-packet-tagging.patch
 ApplyPatch linux-2.6-522-iptables-connection-tagging.patch
diff --git a/linux-2.6-255-vserver-delta-cow-fix23.diff b/linux-2.6-255-vserver-delta-cow-fix23.diff
new file mode 100644 (file)
index 0000000..dc5b724
--- /dev/null
@@ -0,0 +1,13 @@
+diff -NurpP linux-2.6.38.7-vs2.3.0.37-rc15/fs/namei.c linux-2.6.38.7-vs2.3.0.37-rc15.1/fs/namei.c
+--- linux-2.6.38.7-vs2.3.0.37-rc15/fs/namei.c  2011-04-23 22:33:35.000000000 +0200
++++ linux-2.6.38.7-vs2.3.0.37-rc15.1/fs/namei.c        2011-05-29 22:41:46.000000000 +0200
+@@ -2220,7 +2220,8 @@ int may_open(struct path *path, int acc_
+       }
+ #ifdef        CONFIG_VSERVER_COWBL
+-      if (IS_COW(inode) && (flag & FMODE_WRITE)) {
++      if (IS_COW(inode) && 
++              ((flag & O_ACCMODE) != O_RDONLY)) {
+               if (IS_COW_LINK(inode))
+                       return -EMLINK;
+               inode->i_flags &= ~(S_IXUNLINK|S_IMMUTABLE);