]> asedeno.scripts.mit.edu Git - linux.git/blobdiff - fs/namei.c
Revert "fs: fold open_check_o_direct into do_dentry_open"
[linux.git] / fs / namei.c
index 186bd2464fd5a842480a37c55b57d60d9164cf86..4eb916996345d78bd87b5262ff11769d20d4d29f 100644 (file)
@@ -3367,7 +3367,9 @@ static int do_last(struct nameidata *nd,
                goto out;
        *opened |= FILE_OPENED;
 opened:
-       error = ima_file_check(file, op->acc_mode, *opened);
+       error = open_check_o_direct(file);
+       if (!error)
+               error = ima_file_check(file, op->acc_mode, *opened);
        if (!error && will_truncate)
                error = handle_truncate(file);
 out:
@@ -3447,6 +3449,9 @@ static int do_tmpfile(struct nameidata *nd, unsigned flags,
        error = finish_open(file, child, NULL, opened);
        if (error)
                goto out2;
+       error = open_check_o_direct(file);
+       if (error)
+               fput(file);
 out2:
        mnt_drop_write(path.mnt);
 out: