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  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:   Thu, 10 Jun 2021 12:40:47 +0200
From:   Jan Kara <jack@...e.cz>
To:     Ming Lei <ming.lei@...hat.com>
Cc:     Jan Kara <jack@...e.cz>, linux-fsdevel@...r.kernel.org,
        Christoph Hellwig <hch@...radead.org>,
        Dave Chinner <david@...morbit.com>, ceph-devel@...r.kernel.org,
        Chao Yu <yuchao0@...wei.com>,
        Damien Le Moal <damien.lemoal@....com>,
        "Darrick J. Wong" <darrick.wong@...cle.com>,
        Jaegeuk Kim <jaegeuk@...nel.org>,
        Jeff Layton <jlayton@...nel.org>,
        Johannes Thumshirn <jth@...nel.org>,
        linux-cifs@...r.kernel.org, linux-ext4@...r.kernel.org,
        linux-f2fs-devel@...ts.sourceforge.net, linux-mm@...ck.org,
        linux-xfs@...r.kernel.org, Miklos Szeredi <miklos@...redi.hu>,
        Steve French <sfrench@...ba.org>, Ted Tso <tytso@....edu>,
        Matthew Wilcox <willy@...radead.org>,
        Christoph Hellwig <hch@....de>, Hugh Dickins <hughd@...gle.com>
Subject: Re: [PATCH 01/14] mm: Fix comments mentioning i_mutex

On Thu 10-06-21 17:06:41, Ming Lei wrote:
> On Mon, Jun 07, 2021 at 04:52:11PM +0200, Jan Kara wrote:
> > inode->i_mutex has been replaced with inode->i_rwsem long ago. Fix
> > comments still mentioning i_mutex.
> > 
> > Reviewed-by: Christoph Hellwig <hch@....de>
> > Acked-by: Hugh Dickins <hughd@...gle.com>
> > Signed-off-by: Jan Kara <jack@...e.cz>
> > ---
> 
> ...
> 
> > diff --git a/mm/rmap.c b/mm/rmap.c
> > index 693a610e181d..a35cbbbded0d 100644
> > --- a/mm/rmap.c
> > +++ b/mm/rmap.c
> > @@ -20,9 +20,9 @@
> >  /*
> >   * Lock ordering in mm:
> >   *
> > - * inode->i_mutex	(while writing or truncating, not reading or faulting)
> > + * inode->i_rwsem	(while writing or truncating, not reading or faulting)
> >   *   mm->mmap_lock
> > - *     page->flags PG_locked (lock_page)   * (see huegtlbfs below)
> > + *     page->flags PG_locked (lock_page)   * (see hugetlbfs below)
> >   *       hugetlbfs_i_mmap_rwsem_key (in huge_pmd_share)
> >   *         mapping->i_mmap_rwsem
> >   *           hugetlb_fault_mutex (hugetlbfs specific page fault mutex)
> > @@ -41,7 +41,7 @@
> >   *                             in arch-dependent flush_dcache_mmap_lock,
> >   *                             within bdi.wb->list_lock in __sync_single_inode)
> >   *
> > - * anon_vma->rwsem,mapping->i_mutex      (memory_failure, collect_procs_anon)
> > + * anon_vma->rwsem,mapping->i_mmap_rwsem   (memory_failure, collect_procs_anon)
> 
> This one looks a typo.

Actually it isn't a typo. Memory failure path doesn't touch inode->i_rwsem
at all. It uses mapping->i_mmap_rwsem in collect_procs_file(). So perhaps
the functions listed there should be updated to (collect_procs_anon(),
collect_procs_file()) but the lock name change is IMO correct.

								Honza
-- 
Jan Kara <jack@...e.com>
SUSE Labs, CR

Powered by blists - more mailing lists