diff options
Diffstat (limited to 'fs/jbd2/transaction.c')
-rw-r--r-- | fs/jbd2/transaction.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/fs/jbd2/transaction.c b/fs/jbd2/transaction.c index a1920da22802..10f524c59ea8 100644 --- a/fs/jbd2/transaction.c +++ b/fs/jbd2/transaction.c | |||
@@ -639,6 +639,7 @@ do_get_write_access(handle_t *handle, struct journal_head *jh, | |||
639 | int error; | 639 | int error; |
640 | char *frozen_buffer = NULL; | 640 | char *frozen_buffer = NULL; |
641 | int need_copy = 0; | 641 | int need_copy = 0; |
642 | unsigned long start_lock, time_lock; | ||
642 | 643 | ||
643 | if (is_handle_aborted(handle)) | 644 | if (is_handle_aborted(handle)) |
644 | return -EROFS; | 645 | return -EROFS; |
@@ -654,9 +655,16 @@ repeat: | |||
654 | 655 | ||
655 | /* @@@ Need to check for errors here at some point. */ | 656 | /* @@@ Need to check for errors here at some point. */ |
656 | 657 | ||
658 | start_lock = jiffies; | ||
657 | lock_buffer(bh); | 659 | lock_buffer(bh); |
658 | jbd_lock_bh_state(bh); | 660 | jbd_lock_bh_state(bh); |
659 | 661 | ||
662 | /* If it takes too long to lock the buffer, trace it */ | ||
663 | time_lock = jbd2_time_diff(start_lock, jiffies); | ||
664 | if (time_lock > HZ/10) | ||
665 | trace_jbd2_lock_buffer_stall(bh->b_bdev->bd_dev, | ||
666 | jiffies_to_msecs(time_lock)); | ||
667 | |||
660 | /* We now hold the buffer lock so it is safe to query the buffer | 668 | /* We now hold the buffer lock so it is safe to query the buffer |
661 | * state. Is the buffer dirty? | 669 | * state. Is the buffer dirty? |
662 | * | 670 | * |