Skip to content

Commit 613218f

Browse files
committed
Merge patch series "netfs: Miscellaneous fixes"
David Howells <dhowells@redhat.com> says: Here are some miscellaneous fixes and changes for netfslib: (1) Fix the collection of results during a pause in transmission. (2) Call ->invalidate_cache() only if provided. (3) Fix the rolling buffer to not hammer atomic bit clears when loading from readahead. (4) Fix netfs_unbuffered_read() to return ssize_t. * patches from https://lore.kernel.org/r/20250314164201.1993231-1-dhowells@redhat.com: netfs: Fix netfs_unbuffered_read() to return ssize_t rather than int netfs: Fix rolling_buffer_load_from_ra() to not clear mark bits netfs: Call `invalidate_cache` only if implemented netfs: Fix collection of results during pause when collection offloaded Link: https://lore.kernel.org/r/20250314164201.1993231-1-dhowells@redhat.com Signed-off-by: Christian Brauner <brauner@kernel.org>
2 parents d9ecc77 + 07c574e commit 613218f

File tree

4 files changed

+15
-16
lines changed

4 files changed

+15
-16
lines changed

fs/netfs/direct_read.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -125,9 +125,9 @@ static int netfs_dispatch_unbuffered_reads(struct netfs_io_request *rreq)
125125
* Perform a read to an application buffer, bypassing the pagecache and the
126126
* local disk cache.
127127
*/
128-
static int netfs_unbuffered_read(struct netfs_io_request *rreq, bool sync)
128+
static ssize_t netfs_unbuffered_read(struct netfs_io_request *rreq, bool sync)
129129
{
130-
int ret;
130+
ssize_t ret;
131131

132132
_enter("R=%x %llx-%llx",
133133
rreq->debug_id, rreq->start, rreq->start + rreq->len - 1);
@@ -155,7 +155,7 @@ static int netfs_unbuffered_read(struct netfs_io_request *rreq, bool sync)
155155
else
156156
ret = -EIOCBQUEUED;
157157
out:
158-
_leave(" = %d", ret);
158+
_leave(" = %zd", ret);
159159
return ret;
160160
}
161161

fs/netfs/read_collect.c

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -682,14 +682,16 @@ void netfs_wait_for_pause(struct netfs_io_request *rreq)
682682
trace_netfs_rreq(rreq, netfs_rreq_trace_wait_queue);
683683
prepare_to_wait(&rreq->waitq, &myself, TASK_UNINTERRUPTIBLE);
684684

685-
subreq = list_first_entry_or_null(&stream->subrequests,
686-
struct netfs_io_subrequest, rreq_link);
687-
if (subreq &&
688-
(!test_bit(NETFS_SREQ_IN_PROGRESS, &subreq->flags) ||
689-
test_bit(NETFS_SREQ_MADE_PROGRESS, &subreq->flags))) {
690-
__set_current_state(TASK_RUNNING);
691-
netfs_read_collection(rreq);
692-
continue;
685+
if (!test_bit(NETFS_RREQ_OFFLOAD_COLLECTION, &rreq->flags)) {
686+
subreq = list_first_entry_or_null(&stream->subrequests,
687+
struct netfs_io_subrequest, rreq_link);
688+
if (subreq &&
689+
(!test_bit(NETFS_SREQ_IN_PROGRESS, &subreq->flags) ||
690+
test_bit(NETFS_SREQ_MADE_PROGRESS, &subreq->flags))) {
691+
__set_current_state(TASK_RUNNING);
692+
netfs_read_collection(rreq);
693+
continue;
694+
}
693695
}
694696

695697
if (!test_bit(NETFS_RREQ_IN_PROGRESS, &rreq->flags) ||

fs/netfs/rolling_buffer.c

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -146,10 +146,6 @@ ssize_t rolling_buffer_load_from_ra(struct rolling_buffer *roll,
146146

147147
/* Store the counter after setting the slot. */
148148
smp_store_release(&roll->next_head_slot, to);
149-
150-
for (; ix < folioq_nr_slots(fq); ix++)
151-
folioq_clear(fq, ix);
152-
153149
return size;
154150
}
155151

fs/netfs/write_collect.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -400,7 +400,8 @@ void netfs_write_collection_worker(struct work_struct *work)
400400
trace_netfs_rreq(wreq, netfs_rreq_trace_write_done);
401401

402402
if (wreq->io_streams[1].active &&
403-
wreq->io_streams[1].failed) {
403+
wreq->io_streams[1].failed &&
404+
ictx->ops->invalidate_cache) {
404405
/* Cache write failure doesn't prevent writeback completion
405406
* unless we're in disconnected mode.
406407
*/

0 commit comments

Comments
 (0)