fuse: reject O_DIRECT flag also in fuse_create
authorCsaba Henk <csaba@gluster.com>
Fri, 27 Nov 2009 14:00:14 +0000 (19:30 +0530)
committerGreg Kroah-Hartman <gregkh@suse.de>
Tue, 8 Dec 2009 18:21:37 +0000 (10:21 -0800)
commitb79250a273007d1d7f3884c4bc50860c7910b347
treefdc5775ae8b964495ab2dd3e7d042143e920e650
parentaa7c7f8c1b47d415f3cca42f0a2aa22d8539860e
fuse: reject O_DIRECT flag also in fuse_create

commit 1b7323965a8c6eee9dc4e345a7ae4bff1dc93149 upstream.

The comment in fuse_open about O_DIRECT:

  "VFS checks this, but only _after_ ->open()"

also holds for fuse_create, however, the same kind of check was missing there.

As an impact of this bug, open(newfile, O_RDWR|O_CREAT|O_DIRECT) fails, but a
stub newfile will remain if the fuse server handled the implied FUSE_CREATE
request appropriately.

Other impact: in the above situation ima_file_free() will complain to open/free
imbalance if CONFIG_IMA is set.

Signed-off-by: Csaba Henk <csaba@gluster.com>
Signed-off-by: Miklos Szeredi <mszeredi@suse.cz>
Cc: Harshavardhana <harsha@gluster.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
fs/fuse/dir.c