]> git.baikalelectronics.ru Git - kernel.git/commit
vfs: fix propagation of atomic_open create error on negative dentry
authorSage Weil <sage@inktank.com>
Wed, 15 Aug 2012 20:30:12 +0000 (13:30 -0700)
committerMiklos Szeredi <mszeredi@suse.cz>
Thu, 16 Aug 2012 17:29:09 +0000 (19:29 +0200)
commit4ff4e1a5f4ad9ea55976f2af9403f9cb8190bece
treef8014f9c014c84fdabcacfbde91b839ad32de385
parentb439209dafd8dd05c49b1cdfac921c02f66f5a9a
vfs: fix propagation of atomic_open create error on negative dentry

If ->atomic_open() returns -ENOENT, we take care to return the create
error (e.g., EACCES), if any.  Do the same when ->atomic_open() returns 1
and provides a negative dentry.

This fixes a regression where an unprivileged open O_CREAT fails with
ENOENT instead of EACCES, introduced with the new atomic_open code.  It
is tested by the open/08.t test in the pjd posix test suite, and was
observed on top of fuse (backed by ceph-fuse).

Signed-off-by: Sage Weil <sage@inktank.com>
Signed-off-by: Miklos Szeredi <mszeredi@suse.cz>
fs/namei.c