diff options
| author | Csaba Henk <csaba@gluster.com> | 2009-11-27 09:00:14 -0500 |
|---|---|---|
| committer | Miklos Szeredi <mszeredi@suse.cz> | 2009-11-27 10:37:13 -0500 |
| commit | 1b7323965a8c6eee9dc4e345a7ae4bff1dc93149 (patch) | |
| tree | e0f6708e1bb274a2204919dbcc698be5f5880f0c | |
| parent | a8a8a669ea13d792296737505adc43ccacf3a648 (diff) | |
fuse: reject O_DIRECT flag also in fuse_create
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>
Cc: stable@kernel.org
| -rw-r--r-- | fs/fuse/dir.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/fs/fuse/dir.c b/fs/fuse/dir.c index 8ada78aade58..4787ae6c5c1c 100644 --- a/fs/fuse/dir.c +++ b/fs/fuse/dir.c | |||
| @@ -385,6 +385,9 @@ static int fuse_create_open(struct inode *dir, struct dentry *entry, int mode, | |||
| 385 | if (fc->no_create) | 385 | if (fc->no_create) |
| 386 | return -ENOSYS; | 386 | return -ENOSYS; |
| 387 | 387 | ||
| 388 | if (flags & O_DIRECT) | ||
| 389 | return -EINVAL; | ||
| 390 | |||
| 388 | forget_req = fuse_get_req(fc); | 391 | forget_req = fuse_get_req(fc); |
| 389 | if (IS_ERR(forget_req)) | 392 | if (IS_ERR(forget_req)) |
| 390 | return PTR_ERR(forget_req); | 393 | return PTR_ERR(forget_req); |
