Re: [PATCH 01/27] quota: Convert dqio_mutex to rwsem

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wed 16-08-17 10:23:22, Andreas Dilger wrote:
> On Aug 16, 2017, at 9:41 AM, Jan Kara <jack@xxxxxxx> wrote:
> > 
> > Convert dqio_mutex to rwsem and call it dqio_sem. No functional changes
> > yet.
> > 
> > Signed-off-by: Jan Kara <jack@xxxxxxx>
> > ---
> > fs/ext4/super.c         |  4 ++--
> > fs/ocfs2/quota_global.c | 20 ++++++++++----------
> > fs/ocfs2/quota_local.c  | 10 +++++-----
> > fs/quota/dquot.c        | 28 ++++++++++++++--------------
> > fs/quota/quota_tree.c   |  2 +-
> > fs/super.c              |  2 +-
> > include/linux/quota.h   |  2 +-
> > 7 files changed, 34 insertions(+), 34 deletions(-)
> > 
> > diff --git a/fs/ext4/super.c b/fs/ext4/super.c
> > index d61a70e2193a..8e0c27387ab7 100644
> > --- a/fs/ext4/super.c
> > +++ b/fs/ext4/super.c
> > @@ -5268,8 +5268,8 @@ static int ext4_statfs(struct dentry *dentry, struct kstatfs *buf)
> >   * Process 1                         Process 2
> >   * ext4_create()                     quota_sync()
> >   *   jbd2_journal_start()                  write_dquot()
> > - *   dquot_initialize()                         down(dqio_mutex)
> > - *     down(dqio_mutex)                    jbd2_journal_start()
> > + *   dquot_initialize()                         down(dqio_sem)
> > + *     down(dqio_sem)                           jbd2_journal_start()
> 
> Not a big deal, since this is a comment, but it should probably be changed
> to down_write(dqio_sem) on both lines, as this deadlock wouldn't happen if
> it was down_read(dqio_sem), and it is more consistent with the new usage.

Yes, fixed.

> That said, this comment doesn't appear to be relevant anymore.  At least I
> couldn't find where in those callpaths dqio_mutex/dqio_sem is used anymore.

The comment is still correct (at least at this point in the series) however
it misses a few entries on stack and some names have probably changed. I'll
update it. Thanks for review!

								Honza
-- 
Jan Kara <jack@xxxxxxxx>
SUSE Labs, CR



[Index of Archives]     [Linux Ext4 Filesystem]     [Union Filesystem]     [Filesystem Testing]     [Ceph Users]     [Ecryptfs]     [AutoFS]     [Kernel Newbies]     [Share Photos]     [Security]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux Cachefs]     [Reiser Filesystem]     [Linux RAID]     [Samba]     [Device Mapper]     [CEPH Development]
  Powered by Linux