linux/fs/9p
M. Mohan Kumar b6f4bee02f fs/9p: Fix atomic_open
Return EEXISTS if requested file already exists, without this patch open
call will always succeed even if the file exists and user specified
O_CREAT|O_EXCL.

Following test code can be used to verify this patch. Without this patch
executing following test code on 9p mount will result in printing 'test case
failed' always.

main()
{
        int fd;

        /* first create the file */
        fd = open("./file", O_CREAT|O_WRONLY);
        if (fd < 0) {
                perror("open");
                return -1;
        }
        close(fd);

        /* Now opening same file with O_CREAT|O_EXCL should fail */
        fd = open("./file", O_CREAT|O_EXCL);
        if (fd < 0 && errno == EEXIST)
	        printf("test case pass\n");
        else
	        printf("test case failed\n");
        close(fd);
        return 0;
}

Signed-off-by: M. Mohan Kumar <mohan@in.ibm.com>
Signed-off-by: Eric Van Hensbergen <ericvh@gmail.com>
2013-02-10 16:29:59 -06:00
..
acl.c userns: Pass a userns parameter into posix_acl_to_xattr and posix_acl_from_xattr 2012-09-18 01:01:35 -07:00
acl.h switch posix_acl_create() to umode_t * 2011-08-01 02:09:42 -04:00
cache.c 9p: Reduce object size with CONFIG_NET_9P_DEBUG 2012-01-05 10:51:44 -06:00
cache.h fs/9p: When doing inode lookup compare qid details and inode mode bits. 2011-07-23 09:32:48 -05:00
fid.c 9p: Reduce object size with CONFIG_NET_9P_DEBUG 2012-01-05 10:51:44 -06:00
fid.h fs/9p: Prevent multiple inclusion of same header 2011-03-15 09:57:41 -05:00
Kconfig 9p: remove experimental tag from tested configurations 2011-05-25 08:46:38 -05:00
Makefile fs/9p: Move dotl inode operations into a seperate file 2011-01-11 09:58:07 -06:00
v9fs_vfs.h 9p: propagate umode_t 2012-01-03 22:55:01 -05:00
v9fs.c The following changes since commit 4cbe5a555f: 2012-10-12 09:59:23 +09:00
v9fs.h stop passing nameidata to ->lookup() 2012-07-14 16:34:32 +04:00
vfs_addr.c 9p: Reduce object size with CONFIG_NET_9P_DEBUG 2012-01-05 10:51:44 -06:00
vfs_dentry.c stop passing nameidata * to ->d_revalidate() 2012-07-14 16:34:14 +04:00
vfs_dir.c locking in fs/9p ->readdir() 2013-02-10 16:29:33 -06:00
vfs_file.c fs/9p: Don't use O_TRUNC flag in TOPEN and TLOPEN request 2013-02-10 16:29:47 -06:00
vfs_inode_dotl.c fs/9p: Fix atomic_open 2013-02-10 16:29:59 -06:00
vfs_inode.c fs/9p: Don't use O_TRUNC flag in TOPEN and TLOPEN request 2013-02-10 16:29:47 -06:00
vfs_super.c VFS: Pass mount flags to sget() 2012-07-14 16:38:34 +04:00
xattr_user.c fs/9p: Add support user. xattr 2010-08-02 14:28:35 -05:00
xattr.c 9p: Reduce object size with CONFIG_NET_9P_DEBUG 2012-01-05 10:51:44 -06:00
xattr.h fs/9p: Add xattr callbacks for POSIX ACL 2010-10-28 09:08:46 -05:00