On Wed 16-08-17 10:35:48, Andreas Dilger wrote: > On Aug 16, 2017, at 9:41 AM, Jan Kara <jack@xxxxxxx> wrote: > > > > We need dqio_sem held just for reading when calling ->read_dqblk() in > > dquot_acquire(). Also dqio_sem is not needed when manipulating dquot > > flags (those are protected by dq_lock) > > Nothing against the patch itself, but this comment is a bit confusing. > > It would be good to list this dq_lock dependency at the dq_flags declaration. > Looking through the code that accesses dq_flags, I see dquot_mark_dquot_dirty(), > clear_dquot_dirty(), dquot_commit(), dqput() depend on dq_list_lock, but > I don't see many of the users besides dquot_acquire() and dquot_release() > getting dq_lock, only using the atomic bit operations on dq_flags. Updated changelog to: We need dqio_sem held just for reading when calling ->read_dqblk() in dquot_acquire(). Also dqio_sem is not needed when setting DQ_READ_B and DQ_ACTIVE_B as concurrent reads and dquot activation are serialized by dq_lock. So acquire and release dqio_sem closer to the place where it is needed. This reduces lock hold time and will make locking changes easier. Honza -- Jan Kara <jack@xxxxxxxx> SUSE Labs, CR