From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail03-md.ns.itscom.net ([175.177.155.113]:39615 "EHLO mail03-md.ns.itscom.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754612AbeDYPDg (ORCPT ); Wed, 25 Apr 2018 11:03:36 -0400 From: "J. R. Okajima" Subject: Re: [PATCH] fs: fold open_check_o_direct into do_dentry_open To: Christoph Hellwig Cc: viro@zeniv.linux.org.uk, linux-fsdevel@vger.kernel.org In-Reply-To: <20180320103014.23242-1-hch@lst.de> References: <20180320103014.23242-1-hch@lst.de> Date: Thu, 26 Apr 2018 00:03:34 +0900 Message-ID: <6741.1524668614@jrobl> Sender: linux-fsdevel-owner@vger.kernel.org List-ID: 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? J. R. Okajima