summaryrefslogtreecommitdiffstats
path: root/fs/9p/vfs_inode_dotl.c
diff options
context:
space:
mode:
authorMiklos Szeredi <mszeredi@suse.cz>2013-09-16 14:52:05 +0200
committerAl Viro <viro@zeniv.linux.org.uk>2013-09-16 19:17:24 -0400
commit116cc0225381415b96551f725455d067f63a76a0 (patch)
treeb30640ef8f0c7ef1b412d08f50f3ab28f69e5127 /fs/9p/vfs_inode_dotl.c
parent01c919abaf2f3d6a8e59eddf4ee22df1631ab067 (diff)
downloadtalos-obmc-linux-116cc0225381415b96551f725455d067f63a76a0.tar.gz
talos-obmc-linux-116cc0225381415b96551f725455d067f63a76a0.zip
vfs: don't set FILE_CREATED before calling ->atomic_open()
If O_CREAT|O_EXCL are passed to open, then we know that either - the file is successfully created, or - the operation fails in some way. So previously we set FILE_CREATED before calling ->atomic_open() so the filesystem doesn't have to. This, however, led to bugs in the implementation that went unnoticed when the filesystem didn't check for existence, yet returned success. To prevent this kind of bug, require filesystems to always explicitly set FILE_CREATED on O_CREAT|O_EXCL and verify this in the VFS. Also added a couple more verifications for the result of atomic_open(): - Warn if filesystem set FILE_CREATED despite the lack of O_CREAT. - Warn if filesystem set FILE_CREATED but gave a negative dentry. Signed-off-by: Miklos Szeredi <mszeredi@suse.cz> Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'fs/9p/vfs_inode_dotl.c')
0 files changed, 0 insertions, 0 deletions
OpenPOWER on IntegriCloud