On Wed 16-08-17 11:33:37, Andreas Dilger wrote: > On Aug 16, 2017, at 9:41 AM, Jan Kara <jack@xxxxxxx> wrote: > > > > Push down acquisition of dqio_sem into ->write_file_info() callback. > > Mostly for consistency with other operations. > > > > Signed-off-by: Jan Kara <jack@xxxxxxx> > > --- > > fs/ocfs2/quota_global.c | 9 +++++++-- > > fs/quota/dquot.c | 10 +--------- > > fs/quota/quota_v1.c | 2 ++ > > fs/quota/quota_v2.c | 5 ++++- > > 4 files changed, 14 insertions(+), 12 deletions(-) > > > > diff --git a/fs/ocfs2/quota_global.c b/fs/ocfs2/quota_global.c > > index 4134d557a8e5..6f7c5bd3cbc6 100644 > > --- a/fs/ocfs2/quota_global.c > > +++ b/fs/ocfs2/quota_global.c > > @@ -443,13 +443,18 @@ static int __ocfs2_global_write_info(struct super_block *sb, int type) > > int ocfs2_global_write_info(struct super_block *sb, int type) > > Would be nice if this was named ocfs2_global_write_file_info() so that > it showed up in searches more easily, though not a huge deal. I guess > the same for ocfs2_local_read_file_info() and ocfs2_local_free_file_info(), > if we wanted to be consistent here, but that should go into a separate > patch. Well, rather than adding 'file' into the name I would add 'quota' somewhere. But yes, the name seems too generic. > > { > > int err; > > - struct ocfs2_mem_dqinfo *info = sb_dqinfo(sb, type)->dqi_priv; > > + struct quota_info *dqopt = sb_dqopt(sb); > > + struct ocfs2_mem_dqinfo *info = dqopt->info[type].dqi_priv; > > > > + down_write(&dqopt->dqio_sem); > > err = ocfs2_qinfo_lock(info, 1); > > - if (err < 0) > > + if (err < 0) { > > + up_write(&dqopt->dqio_sem); > > return err; > > + } > > goto out_sem? > > > err = __ocfs2_global_write_info(sb, type); > > ocfs2_qinfo_unlock(info, 1); > > out_sem: Thanks, done. Honza -- Jan Kara <jack@xxxxxxxx> SUSE Labs, CR