All of lore.kernel.org
 help / color / mirror / Atom feed
From: Christoph Hellwig <hch@lst.de>
To: "J. R. Okajima" <hooanon05g@gmail.com>
Cc: Christoph Hellwig <hch@lst.de>,
	viro@zeniv.linux.org.uk, linux-fsdevel@vger.kernel.org
Subject: Re: [PATCH] fs: fold open_check_o_direct into do_dentry_open
Date: Thu, 26 Apr 2018 09:19:00 +0200	[thread overview]
Message-ID: <20180426071900.GA14524@lst.de> (raw)
In-Reply-To: <6741.1524668614@jrobl>

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---

  reply	other threads:[~2018-04-26  7:17 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-03-20 10:30 [PATCH] fs: fold open_check_o_direct into do_dentry_open Christoph Hellwig
2018-04-25 15:03 ` J. R. Okajima
2018-04-26  7:19   ` Christoph Hellwig [this message]
2018-04-26 15:50     ` J. R. Okajima

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20180426071900.GA14524@lst.de \
    --to=hch@lst.de \
    --cc=hooanon05g@gmail.com \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=viro@zeniv.linux.org.uk \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.