[PATCH] Btrfs: Add an alarm for long-running transactions.

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

 



If we're waiting for a transaction to end, and it started more than five
minutes ago, emit a warning.

Signed-off-by: Chris Ball <cjb@xxxxxxxxxx>
---
 fs/btrfs/transaction.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/fs/btrfs/transaction.c b/fs/btrfs/transaction.c
index f94c2ad..9fa477c 100644
--- a/fs/btrfs/transaction.c
+++ b/fs/btrfs/transaction.c
@@ -80,6 +80,7 @@ static noinline int join_transaction(struct btrfs_root *root)
 		root->fs_info->running_transaction = cur_trans;
 		spin_unlock(&root->fs_info->new_trans_lock);
 	} else {
+		WARN_ON_ONCE(get_seconds() - cur_trans->start_time > 300);
 		cur_trans->num_writers++;
 		cur_trans->num_joined++;
 	}
-- 
1.6.1.3
--
To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Filesystem Development]     [Linux NFS]     [Linux NILFS]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux