[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <1333637940-31884-35-git-send-email-miklos@szeredi.hu>
Date: Thu, 5 Apr 2012 16:59:00 +0200
From: Miklos Szeredi <miklos@...redi.hu>
To: viro@...IV.linux.org.uk
Cc: linux-fsdevel@...r.kernel.org, linux-kernel@...r.kernel.org,
hch@...radead.org, mszeredi@...e.cz
Subject: [PATCH 34/34] vfs: move O_DIRECT check to common code
From: Miklos Szeredi <mszeredi@...e.cz>
Perform open_check_o_direct() in a common place in do_last after opening the
file.
Signed-off-by: Miklos Szeredi <mszeredi@...e.cz>
---
fs/namei.c | 17 +++++------------
1 files changed, 5 insertions(+), 12 deletions(-)
diff --git a/fs/namei.c b/fs/namei.c
index ed0b72b..07fae42 100644
--- a/fs/namei.c
+++ b/fs/namei.c
@@ -2327,22 +2327,15 @@ static struct file *atomic_open(struct nameidata *nd, struct dentry *dentry,
* here.
*/
error = may_open(&filp->f_path, acc_mode, open_flag);
- if (error)
- goto out_fput;
-
- error = open_check_o_direct(filp);
- if (error)
- goto out_fput;
+ if (error) {
+ fput(filp);
+ filp = ERR_PTR(error);
+ }
out:
dput(dentry);
return filp;
-out_fput:
- fput(filp);
- filp = ERR_PTR(error);
- goto out;
-
no_open:
if (need_lookup) {
dentry = lookup_real(dir, dentry, nd);
@@ -2650,10 +2643,10 @@ common:
}
if (IS_ERR(filp))
goto out;
+opened:
error = open_check_o_direct(filp);
if (error)
goto exit_fput;
-opened:
error = ima_file_check(filp, op->acc_mode);
if (error)
goto exit_fput;
--
1.7.7
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists