Unionfs: bugfix -- set copied up open file mode to read and write
authorErez_Zadok <ezk@cs.sunysb.edu>
Sat, 14 Jul 2007 07:25:02 +0000 (03:25 -0400)
committerErez Zadok <ezk@cs.sunysb.edu>
Fri, 29 Apr 2011 02:24:17 +0000 (22:24 -0400)
commit3fb6d616cbcc10a1f1abf862d40d16306fed2356
treeabbd53fa6d0fc58833fe679214efa4c66e5242c7
parent8798c7dba84d23f2b648ba68f73a779e8d847af4
Unionfs: bugfix -- set copied up open file mode to read and write

When we copyup a file, we used to set the new file's open mode to write
only.  But we need read permission too.  We need write permission because
we're creating a new file; and we need read permission because the original
file had to have been readable.  If we don't set the new files permission to
BOTH read and write, we get -EBADF when trying calling vfs_read/vfs_write on
a copied up file.  (This fix is somewhat related to unionfs_readpage fixes
that use vfs_read instead of calling the lower readpage.)

Signed-off-by: Erez Zadok <ezk@cs.sunysb.edu>
fs/unionfs/copyup.c