aboutsummaryrefslogtreecommitdiffstats
path: root/fs/fuse
diff options
context:
space:
mode:
authorMiklos Szeredi <miklos@szeredi.hu>2005-09-30 14:59:02 -0400
committerLinus Torvalds <torvalds@g5.osdl.org>2005-09-30 15:41:18 -0400
commitdd190d066b7ded8c44b2b67dd0a14bed01525d3c (patch)
treea76e0425ca910b3f0bf6c773349004feceba27f3 /fs/fuse
parentdaa35edc0a967d1f77c2e2c1346f57d04371487a (diff)
[PATCH] fuse: check O_DIRECT
Check O_DIRECT and return -EINVAL error in open. dentry_open() also checks this but only after the open method is called. This patch optimizes away the unnecessary upcalls in this case. It could be a correctness issue too: if filesystem has open() with side effect, then it should fail before doing the open, not after. Signed-off-by: Miklos Szeredi <miklos@szeredi.hu> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'fs/fuse')
-rw-r--r--fs/fuse/file.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/fs/fuse/file.c b/fs/fuse/file.c
index 6454022b0536..657ab11c173b 100644
--- a/fs/fuse/file.c
+++ b/fs/fuse/file.c
@@ -23,6 +23,10 @@ int fuse_open_common(struct inode *inode, struct file *file, int isdir)
23 struct fuse_file *ff; 23 struct fuse_file *ff;
24 int err; 24 int err;
25 25
26 /* VFS checks this, but only _after_ ->open() */
27 if (file->f_flags & O_DIRECT)
28 return -EINVAL;
29
26 err = generic_file_open(inode, file); 30 err = generic_file_open(inode, file);
27 if (err) 31 if (err)
28 return err; 32 return err;