lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Mon, 20 Dec 2021 07:59:56 +1100
From:   "NeilBrown" <neilb@...e.de>
To:     "Mark Hemment" <markhemm@...glemail.com>
Cc:     "Trond Myklebust" <trond.myklebust@...merspace.com>,
        "Anna Schumaker" <anna.schumaker@...app.com>,
        "Chuck Lever" <chuck.lever@...cle.com>,
        "Andrew Morton" <akpm@...ux-foundation.org>,
        "Mel Gorman" <mgorman@...e.de>,
        "Christoph Hellwig" <hch@...radead.org>,
        "David Howells" <dhowells@...hat.com>, linux-nfs@...r.kernel.org,
        linux-mm@...ck.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH 08/18] MM: Add AS_CAN_DIO mapping flag

On Mon, 20 Dec 2021, Mark Hemment wrote:
> On Thu, 16 Dec 2021 at 23:57, NeilBrown <neilb@...e.de> wrote:
> >
> > Currently various places test if direct IO is possible on a file by
> > checking for the existence of the direct_IO address space operation.
> > This is a poor choice, as the direct_IO operation may not be used - it is
> > only used if the generic_file_*_iter functions are called for direct IO
> > and some filesystems - particularly NFS - don't do this.
> >
> > Instead, introduce a new mapping flag: AS_CAN_DIO and change the various
> > places to check this (avoiding a pointer dereference).
> > unlock_new_inode() will set this flag if ->direct_IO is present, so
> > filesystems do not need to be changed.
> ...
> > diff --git a/fs/inode.c b/fs/inode.c
> > index 6b80a51129d5..bae65ccecdb1 100644
> > --- a/fs/inode.c
> > +++ b/fs/inode.c
> > @@ -1008,6 +1008,9 @@ EXPORT_SYMBOL(lockdep_annotate_inode_mutex_key);
> >  void unlock_new_inode(struct inode *inode)
> >  {
> >         lockdep_annotate_inode_mutex_key(inode);
> > +       if (inode->i_mapping->a_ops &&
> > +           inode->i_mapping->a_ops->direct_IO)
> > +               set_bit(AS_CAN_DIO, &inode->i_mapping->flags);
> >         spin_lock(&inode->i_lock);
> >         WARN_ON(!(inode->i_state & I_NEW));
> >         inode->i_state &= ~I_NEW & ~I_CREATING;
> 
> Does d_instantiate_new() also need to set AS_CAN_DIO?

Yes it does - thanks for catching that.  I'll update my patch.

Thanks,
NeilBrown

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ