Skip to contentSkip to conversation

btrfs: set task state with schedule_timeout_uninterruptible()

PATCH Superseded Kulikov Vasiliy 2 participants 3 messages Jul 26, 2010 – Jul 27, 2010

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 btrfs: set task state with schedule_timeout_uninterruptible()

worker_loop() uses schedule_timeout() without setting state to STATE_(UN)INTERRUPTIBLE. As it is called in cycle without checking of pending signals, use schedule_timeout_uninterruptible().

---
 fs/btrfs/async-thread.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
fs/btrfs/async-thread.c +1 -1
index 7ec1409..54eb070 100644
@@ -362,7 +362,7 @@ again:
 				 * worker->working is still 1, so nobody
 				 * is going to try and wake us up
 				 */
-				schedule_timeout(1);
+				schedule_timeout_uninterruptible(1);
 				smp_mb();
 				if (!list_empty(&worker->pending) ||
 				    !list_empty(&worker->prio_pending))
Signature · 1 line
1.7.0.4
#1 lore raw
Quoted 14 lines · Kulikov Vasiliy

worker_loop() uses schedule_timeout() without setting state to STATE_(UN)INTERRUPTIBLE. As it is called in cycle without checking of pending signals, use schedule_timeout_uninterruptible().

---
  fs/btrfs/async-thread.c |    2 +-
  1 files changed, 1 insertions(+), 1 deletions(-)
fs/btrfs/async-thread.c +0 -0
index 7ec1409..54eb070 100644

fs/btrfs/async-thread.c again: · line 365

Quoted 5 lines
fs/btrfs/async-thread.c +1 -1
@@ -362,7 +362,7 @@ again:
  				 * worker->working is still 1, so nobody
  				 * is going to try and wake us up
  				 */
-				schedule_timeout(1);
+				schedule_timeout_uninterruptible(1);

I found there is the same problem in the other place of the btrfs, could you fix them?

Thanks!
Miao

Quoted 3 lines
fs/btrfs/async-thread.c +0 -0
  				smp_mb();
  				if (!list_empty(&worker->pending) ||
  				    !list_empty(&worker->prio_pending))
#2 lore raw

PATCH v2 1/1 btrfs: set task state with schedule_timeout_uninterruptible()

schedule_timeout() is used without setting state to STATE_(UN)INTERRUPTIBLE. As it is called without checking of pending signals, use schedule_timeout_uninterruptible() instead.

---
 fs/btrfs/async-thread.c |    2 +-
 fs/btrfs/extent-tree.c  |    6 +++---
 fs/btrfs/ordered-data.c |    2 +-
 3 files changed, 5 insertions(+), 5 deletions(-)
fs/btrfs/async-thread.c +1 -1
index 7ec1409..54eb070 100644
@@ -362,7 +362,7 @@ again:
 				 * worker->working is still 1, so nobody
 				 * is going to try and wake us up
 				 */
-				schedule_timeout(1);
+				schedule_timeout_uninterruptible(1);
 				smp_mb();
 				if (!list_empty(&worker->pending) ||
 				    !list_empty(&worker->prio_pending))
fs/btrfs/extent-tree.c +3 -3
index 32d0940..5b55a20 100644
@@ -365,7 +365,7 @@ again:
 			up_read(&fs_info->extent_commit_sem);
 			mutex_unlock(&caching_ctl->mutex);
 			if (btrfs_transaction_in_commit(fs_info))
-				schedule_timeout(1);
+				schedule_timeout_uninterruptible(1);
 			else
 				cond_resched();
 			goto again;
@@ -2237,7 +2237,7 @@ again:
 			node = rb_next(node);
 		}
 		spin_unlock(&delayed_refs->lock);
-		schedule_timeout(1);
+		schedule_timeout_uninterruptible(1);
 		goto again;
 	}
 out:
@@ -3686,7 +3686,7 @@ int btrfs_delalloc_reserve_metadata(struct inode *inode, u64 num_bytes)
 	int ret;
 
 	if (btrfs_transaction_in_commit(root->fs_info))
-		schedule_timeout(1);
+		schedule_timeout_uninterruptible(1);
 
 	num_bytes = ALIGN(num_bytes, root->sectorsize);
 again:
fs/btrfs/ordered-data.c +1 -1
index e56c72b..9ff49e5 100644
@@ -576,7 +576,7 @@ again:
 	}
 	if (found || test_range_bit(&BTRFS_I(inode)->io_tree, start, orig_end,
 			   EXTENT_DELALLOC, 0, NULL)) {
-		schedule_timeout(1);
+		schedule_timeout_uninterruptible(1);
 		goto again;
 	}
 	return 0;
Signature · 1 line
1.7.0.4