--- linux-2.6.16.17/fs/namei.c 2006-04-17 19:46:42 +0200 +++ linux-2.6.16.17/fs/namei.c 2006-05-21 17:18:24 +0200 @@ -1536,8 +1536,12 @@ int may_open(struct nameidata *nd, int a return -EISDIR; #ifdef CONFIG_VSERVER_COWBL - if (IS_COW_LINK(inode) && (flag & FMODE_WRITE)) - return -EMLINK; + if (IS_COW(inode) && (flag & FMODE_WRITE)) { + if (IS_COW_LINK(inode)) + return -EMLINK; + inode->i_flags &= ~(S_IUNLINK|S_IMMUTABLE); + mark_inode_dirty(inode); + } #endif error = vfs_permission(nd, acc_mode); if (error) --- linux-2.6.16.17/include/linux/fs.h 2006-03-27 20:01:57 +0200 +++ linux-2.6.16.17/include/linux/fs.h 2006-05-21 17:16:50 +0200 @@ -176,9 +176,8 @@ extern int dir_notify_enable; #define IS_SWAPFILE(inode) ((inode)->i_flags & S_SWAPFILE) #define IS_PRIVATE(inode) ((inode)->i_flags & S_PRIVATE) -#define IS_COW_LINK(inode) (S_ISREG((inode)->i_mode) && \ - ((inode)->i_nlink > 1) && \ - IS_IUNLINK(inode) && IS_IMMUTABLE(inode)) +#define IS_COW(inode) (IS_IUNLINK(inode) && IS_IMMUTABLE(inode)) +#define IS_COW_LINK(inode) (S_ISREG((inode)->i_mode) && ((inode)->i_nlink > 1)) /* the read-only stuff doesn't really belong here, but any other place is probably as bad and I don't want to create yet another include file. */