Re: [patch V2 6/7] fs/jbd2: Make state lock a spinlock

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

 



On Thu, Aug 01, 2019 at 03:01:32AM +0200, Thomas Gleixner wrote:

> @@ -1931,7 +1932,7 @@ static void __jbd2_journal_temp_unlink_b
>  	transaction_t *transaction;
>  	struct buffer_head *bh = jh2bh(jh);
>  
> -	J_ASSERT_JH(jh, jbd_is_locked_bh_state(bh));
> +	assert_spin_locked(&jh->state_lock);
>  	transaction = jh->b_transaction;
>  	if (transaction)
>  		assert_spin_locked(&transaction->t_journal->j_list_lock);

> @@ -2415,7 +2416,7 @@ void __jbd2_journal_file_buffer(struct j
>  	int was_dirty = 0;
>  	struct buffer_head *bh = jh2bh(jh);
>  
> -	J_ASSERT_JH(jh, jbd_is_locked_bh_state(bh));
> +	assert_spin_locked(&jh->state_lock);
>  	assert_spin_locked(&transaction->t_journal->j_list_lock);
>  
>  	J_ASSERT_JH(jh, jh->b_jlist < BJ_Types);

> @@ -2500,7 +2501,7 @@ void __jbd2_journal_refile_buffer(struct
>  	int was_dirty, jlist;
>  	struct buffer_head *bh = jh2bh(jh);
>  
> -	J_ASSERT_JH(jh, jbd_is_locked_bh_state(bh));
> +	assert_spin_locked(&jh->state_lock);
>  	if (jh->b_transaction)
>  		assert_spin_locked(&jh->b_transaction->t_journal->j_list_lock);
>  

Do those want to be:

  lockdep_assert_held(&jh->state_lock);

instead? The difference is of course that lockdep_assert_held() requires
the current context to hold the lock, where assert_*_locked() merely
checks _someone_ holds it.



[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