diff --git a/fs/netfs/write_issue.c b/fs/netfs/write_issue.c index 04e66d587f77..8e708d1f7c9d 100644 --- a/fs/netfs/write_issue.c +++ b/fs/netfs/write_issue.c @@ -427,6 +427,8 @@ static int netfs_write_folio(struct netfs_io_request *wreq, * Also skip uploading for data that's been read and just needs copying * to the cache. */ + + spin_lock(&wreq->lock); for (int s = 0; s < NR_IO_STREAMS; s++) { stream = &wreq->io_streams[s]; stream->submit_off = foff; @@ -488,6 +490,7 @@ static int netfs_write_folio(struct netfs_io_request *wreq, for (int s = 0; s < NR_IO_STREAMS; s++) netfs_issue_write(wreq, &wreq->io_streams[s]); + spin_unlock(&wreq->lock); _leave(" = 0"); return 0; }