On Tue 25-05-21 14:37:29, Darrick J. Wong wrote:
> On Tue, May 25, 2021 at 03:50:44PM +0200, Jan Kara wrote:
> > Use invalidate_lock instead of XFS internal i_mmap_lock. The intended
> > purpose of invalidate_lock is exactly the same. Note that the locking in
> > __xfs_filemap_fault() slightly changes as filemap_fault() already takes
> > invalidate_lock.
> > 
> > Reviewed-by: Christoph Hellwig <[email protected]>
> > CC: <[email protected]>
> > CC: "Darrick J. Wong" <[email protected]>
> 
> It's [email protected] now.

OK, updated.

> > @@ -355,8 +358,11 @@ xfs_isilocked(
> >  
> >     if (lock_flags & (XFS_MMAPLOCK_EXCL|XFS_MMAPLOCK_SHARED)) {
> >             if (!(lock_flags & XFS_MMAPLOCK_SHARED))
> > -                   return !!ip->i_mmaplock.mr_writer;
> > -           return rwsem_is_locked(&ip->i_mmaplock.mr_lock);
> > +                   return !debug_locks ||
> > +                           lockdep_is_held_type(
> > +                                   &VFS_I(ip)->i_mapping->invalidate_lock,
> > +                                   0);
> > +           return rwsem_is_locked(&VFS_I(ip)->i_mapping->invalidate_lock);
> 
> This doesn't look right...
> 
> If lockdep is disabled, we always return true for
> xfs_isilocked(ip, XFS_MMAPLOCK_EXCL) even if nobody holds the lock?
> 
> Granted, you probably just copy-pasted from the IOLOCK_SHARED clause
> beneath it.  Er... oh right, preichl was messing with all that...
> 
> https://lore.kernel.org/linux-xfs/[email protected]/

Indeed copy-paste programming ;) It certainly makes the assertions happy
but useless. Should I pull the patch you reference into the series? It
seems to have been uncontroversial and reviewed. Or will you pull the
series to xfs tree so I can just rebase on top?

                                                                Honza
-- 
Jan Kara <[email protected]>
SUSE Labs, CR


_______________________________________________
Linux-f2fs-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel

Reply via email to