kernel-ark/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
cache.c
cache.h
fid.c
fid.h
Kconfig
Makefile
v9fs_vfs.h
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
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
xattr.c
xattr.h fs/9p: Add xattr callbacks for POSIX ACL 2010-10-28 09:08:46 -05:00