Skip to content

Commit 22de489

Browse files
dhowellsbrauner
authored andcommitted
netfs: Use bh-disabling spinlocks for rreq->lock
Use bh-disabling spinlocks when accessing rreq->lock because, in the future, it may be twiddled from softirq context when cleanup is driven from cache backend DIO completion. Signed-off-by: David Howells <[email protected]> cc: Jeff Layton <[email protected]> cc: [email protected] cc: [email protected] Link: https://lore.kernel.org/r/[email protected]/ # v2 Signed-off-by: Christian Brauner <[email protected]>
1 parent 24c90a7 commit 22de489

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

fs/netfs/write_collect.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -473,7 +473,7 @@ static void netfs_collect_write_results(struct netfs_io_request *wreq)
473473

474474
cancel:
475475
/* Remove if completely consumed. */
476-
spin_lock(&wreq->lock);
476+
spin_lock_bh(&wreq->lock);
477477

478478
remove = front;
479479
list_del_init(&front->rreq_link);
@@ -489,7 +489,7 @@ static void netfs_collect_write_results(struct netfs_io_request *wreq)
489489
}
490490
}
491491

492-
spin_unlock(&wreq->lock);
492+
spin_unlock_bh(&wreq->lock);
493493
netfs_put_subrequest(remove, false,
494494
notes & SAW_FAILURE ?
495495
netfs_sreq_trace_put_cancel :

fs/netfs/write_issue.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -191,7 +191,7 @@ static void netfs_prepare_write(struct netfs_io_request *wreq,
191191
* the list. The collector only goes nextwards and uses the lock to
192192
* remove entries off of the front.
193193
*/
194-
spin_lock(&wreq->lock);
194+
spin_lock_bh(&wreq->lock);
195195
list_add_tail(&subreq->rreq_link, &stream->subrequests);
196196
if (list_is_first(&subreq->rreq_link, &stream->subrequests)) {
197197
stream->front = subreq;
@@ -202,7 +202,7 @@ static void netfs_prepare_write(struct netfs_io_request *wreq,
202202
}
203203
}
204204

205-
spin_unlock(&wreq->lock);
205+
spin_unlock_bh(&wreq->lock);
206206

207207
stream->construct = subreq;
208208
}

0 commit comments

Comments
 (0)