linux-xfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Christoph Hellwig <hch@lst.de>
To: Brian Foster <bfoster@redhat.com>
Cc: Christoph Hellwig <hch@lst.de>,
	linux-xfs@vger.kernel.org, linux-fsdevel@vger.kernel.org
Subject: Re: [PATCH 2/5] xfs: remove i_iolock and use i_rwsem in the VFS inode instead
Date: Tue, 15 Nov 2016 17:52:04 +0100	[thread overview]
Message-ID: <20161115165204.GA1490@lst.de> (raw)
In-Reply-To: <20161115153408.GA65218@bfoster.bfoster>

On Tue, Nov 15, 2016 at 10:34:10AM -0500, Brian Foster wrote:
> > @@ -1592,12 +1591,10 @@ xfs_vm_bmap(
> >  	 * that on reflinks inodes, so we have to skip out here.  And yes,
> >  	 * 0 is the magic code for a bmap error..
> >  	 */
> > -	if (xfs_is_reflink_inode(ip)) {
> > -		xfs_iunlock(ip, XFS_IOLOCK_SHARED);
> > +	if (xfs_is_reflink_inode(ip))
> >  		return 0;
> > -	}
> > +
> >  	filemap_write_and_wait(mapping);
> > -	xfs_iunlock(ip, XFS_IOLOCK_SHARED);
> 
> The commit log makes no mention of dropping lock usage, unless I missed
> where the inode lock is taken elsewhere..?

For swapon, the only case where the lock matter is is taken by the
calller now.  For the ioctl it simply doesn't matter as the result
will be stale by the time we return.

> >  
> >  	if (lock_flags & (XFS_IOLOCK_EXCL|XFS_IOLOCK_SHARED)) {
> >  		if (!(lock_flags & XFS_IOLOCK_SHARED))
> > -			return !!ip->i_iolock.mr_writer;
> > -		return rwsem_is_locked(&ip->i_iolock.mr_lock);
> > +			return !debug_locks ||
> > +				lockdep_is_held_type(&VFS_I(ip)->i_rwsem, 0);
> > +		return rwsem_is_locked(&VFS_I(ip)->i_rwsem);
> 
> So if I read this correctly, we can no longer safely assert that an
> inode is not exclusively locked because the debug_locks == 0 case would
> always tell us it is. It doesn't look like we do that today, but it
> warrants a comment IMO.

Ok, I can add a comment.

  reply	other threads:[~2016-11-15 16:52 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-11-13 19:07 an iomap-based direct I/O implementation V3 Christoph Hellwig
2016-11-13 19:07 ` [PATCH 1/5] locking/lockdep: Provide a type check for lock_is_held Christoph Hellwig
2016-11-13 19:07 ` [PATCH 2/5] xfs: remove i_iolock and use i_rwsem in the VFS inode instead Christoph Hellwig
2016-11-15 15:34   ` Brian Foster
2016-11-15 16:52     ` Christoph Hellwig [this message]
2016-11-13 19:07 ` [PATCH 3/5] fs: make sb_init_dio_done_wq available outside of direct-io.c Christoph Hellwig
2016-11-13 19:07 ` [PATCH 4/5] iomap: implement direct I/O Christoph Hellwig
2016-11-13 19:07 ` [PATCH 5/5] xfs: use iomap_dio_rw Christoph Hellwig
2016-11-15 15:34   ` Brian Foster
2016-11-15 16:52     ` Christoph Hellwig
2016-11-21 16:52 ` an iomap-based direct I/O implementation V3 Christoph Hellwig
2016-11-21 22:34   ` Dave Chinner
2016-11-22 22:52 ` Dave Chinner
2016-11-22 23:12   ` Jens Axboe
2016-11-23  0:02     ` Dave Chinner
2016-11-23  0:40       ` Jens Axboe
2016-11-23  8:36         ` Christoph Hellwig
2016-11-27 23:16           ` Dave Chinner
  -- strict thread matches above, loose matches on Subject: below --
2016-11-29 17:28 an iomap-based direct I/O implementation V4 Christoph Hellwig
2016-11-29 17:28 ` [PATCH 2/5] xfs: remove i_iolock and use i_rwsem in the VFS inode instead Christoph Hellwig
2016-11-04 16:21 an iomap-based direct I/O implementation V2 Christoph Hellwig
2016-11-04 16:21 ` [PATCH 2/5] xfs: remove i_iolock and use i_rwsem in the VFS inode instead Christoph Hellwig

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=20161115165204.GA1490@lst.de \
    --to=hch@lst.de \
    --cc=bfoster@redhat.com \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-xfs@vger.kernel.org \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).