Return-Path: Received: from mx2.suse.de ([195.135.220.15]:55938 "EHLO mx1.suse.de" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1752357AbdHQQrP (ORCPT ); Thu, 17 Aug 2017 12:47:15 -0400 Date: Thu, 17 Aug 2017 18:47:12 +0200 From: Jan Kara To: Andreas Dilger Cc: Jan Kara , linux-fsdevel@vger.kernel.org, Wang Shilong Subject: Re: [PATCH 01/27] quota: Convert dqio_mutex to rwsem Message-ID: <20170817164712.GC28850@quack2.suse.cz> References: <20170816154127.7048-1-jack@suse.cz> <20170816154127.7048-2-jack@suse.cz> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Sender: linux-fsdevel-owner@vger.kernel.org List-ID: On Wed 16-08-17 10:23:22, Andreas Dilger wrote: > On Aug 16, 2017, at 9:41 AM, Jan Kara wrote: > > > > Convert dqio_mutex to rwsem and call it dqio_sem. No functional changes > > yet. > > > > Signed-off-by: Jan Kara > > --- > > 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 SUSE Labs, CR