On Thu, Apr 26, 2018 at 12:03:34AM +0900, J. R. Okajima wrote: > Christoph Hellwig: > > do_dentry_open is where we do the actual open of the file, so this is > > where we should do our O_DIRECT sanity check to cover all potential > > callers. > ::: > > diff --git a/fs/namei.c b/fs/namei.c > > index 920a828ab2ce..9d6d8e8aed55 100644 > > --- a/fs/namei.c > > +++ b/fs/namei.c > > @@ -3374,9 +3374,7 @@ static int do_last(struct nameidata *nd, > > goto out; > > *opened |= FILE_OPENED; > > opened: > > - error = open_check_o_direct(file); > > - if (!error) > > - error = ima_file_check(file, op->acc_mode, *opened); > > + error = ima_file_check(file, op->acc_mode, *opened); > > if (!error && will_truncate) > > error = handle_truncate(file); > > Removing the check from here may cause a problem I am afraid. > In open(O_ATOMIC|O_DIRECT) case, the check is totally gone, isn't it? You mean O_DIRECT using ->atomic_open? Those are supposed to call finish_open(), which calls do_dentry_open and thus the O_DIRECT check. > > > > J. R. Okajima ---end quoted text---