Unverified Commit 613218fc authored by Christian Brauner's avatar Christian Brauner
Browse files

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: default avatarChristian Brauner <brauner@kernel.org>
parents d9ecc771 07c574eb
Loading
Loading
Loading
Loading
+3 −3
Original line number Diff line number Diff line
@@ -125,9 +125,9 @@ static int netfs_dispatch_unbuffered_reads(struct netfs_io_request *rreq)
 * Perform a read to an application buffer, bypassing the pagecache and the
 * local disk cache.
 */
static int netfs_unbuffered_read(struct netfs_io_request *rreq, bool sync)
static ssize_t netfs_unbuffered_read(struct netfs_io_request *rreq, bool sync)
{
	int ret;
	ssize_t ret;

	_enter("R=%x %llx-%llx",
	       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)
	else
		ret = -EIOCBQUEUED;
out:
	_leave(" = %d", ret);
	_leave(" = %zd", ret);
	return ret;
}

+10 −8
Original line number Diff line number Diff line
@@ -682,6 +682,7 @@ void netfs_wait_for_pause(struct netfs_io_request *rreq)
		trace_netfs_rreq(rreq, netfs_rreq_trace_wait_queue);
		prepare_to_wait(&rreq->waitq, &myself, TASK_UNINTERRUPTIBLE);

		if (!test_bit(NETFS_RREQ_OFFLOAD_COLLECTION, &rreq->flags)) {
			subreq = list_first_entry_or_null(&stream->subrequests,
							  struct netfs_io_subrequest, rreq_link);
			if (subreq &&
@@ -691,6 +692,7 @@ void netfs_wait_for_pause(struct netfs_io_request *rreq)
				netfs_read_collection(rreq);
				continue;
			}
		}

		if (!test_bit(NETFS_RREQ_IN_PROGRESS, &rreq->flags) ||
		    !test_bit(NETFS_RREQ_PAUSE, &rreq->flags))
+0 −4
Original line number Diff line number Diff line
@@ -146,10 +146,6 @@ ssize_t rolling_buffer_load_from_ra(struct rolling_buffer *roll,

	/* Store the counter after setting the slot. */
	smp_store_release(&roll->next_head_slot, to);

	for (; ix < folioq_nr_slots(fq); ix++)
		folioq_clear(fq, ix);

	return size;
}

+2 −1
Original line number Diff line number Diff line
@@ -400,7 +400,8 @@ void netfs_write_collection_worker(struct work_struct *work)
	trace_netfs_rreq(wreq, netfs_rreq_trace_write_done);

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