|
21 | 21 | #define NEED_RETRY 0x10 /* A front op requests retrying */
|
22 | 22 | #define SAW_FAILURE 0x20 /* One stream or hit a permanent failure */
|
23 | 23 |
|
| 24 | +static void netfs_dump_request(const struct netfs_io_request *rreq) |
| 25 | +{ |
| 26 | + pr_err("Request R=%08x r=%d fl=%lx or=%x e=%ld\n", |
| 27 | + rreq->debug_id, refcount_read(&rreq->ref), rreq->flags, |
| 28 | + rreq->origin, rreq->error); |
| 29 | + pr_err(" st=%llx tsl=%zx/%llx/%llx\n", |
| 30 | + rreq->start, rreq->transferred, rreq->submitted, rreq->len); |
| 31 | + pr_err(" cci=%llx/%llx/%llx\n", |
| 32 | + rreq->cleaned_to, rreq->collected_to, atomic64_read(&rreq->issued_to)); |
| 33 | + pr_err(" iw=%pSR\n", rreq->netfs_ops->issue_write); |
| 34 | + for (int i = 0; i < NR_IO_STREAMS; i++) { |
| 35 | + const struct netfs_io_subrequest *sreq; |
| 36 | + const struct netfs_io_stream *s = &rreq->io_streams[i]; |
| 37 | + |
| 38 | + pr_err(" str[%x] s=%x e=%d acnf=%u,%u,%u,%u\n", |
| 39 | + s->stream_nr, s->source, s->error, |
| 40 | + s->avail, s->active, s->need_retry, s->failed); |
| 41 | + pr_err(" str[%x] ct=%llx t=%zx\n", |
| 42 | + s->stream_nr, s->collected_to, s->transferred); |
| 43 | + list_for_each_entry(sreq, &s->subrequests, rreq_link) { |
| 44 | + pr_err(" sreq[%x:%x] sc=%u s=%llx t=%zx/%zx r=%d f=%lx\n", |
| 45 | + sreq->stream_nr, sreq->debug_index, sreq->source, |
| 46 | + sreq->start, sreq->transferred, sreq->len, |
| 47 | + refcount_read(&sreq->ref), sreq->flags); |
| 48 | + } |
| 49 | + } |
| 50 | +} |
| 51 | + |
24 | 52 | /*
|
25 | 53 | * Successful completion of write of a folio to the server and/or cache. Note
|
26 | 54 | * that we are not allowed to lock the folio here on pain of deadlocking with
|
@@ -87,6 +115,12 @@ static void netfs_writeback_unlock_folios(struct netfs_io_request *wreq,
|
87 | 115 | unsigned long long collected_to = wreq->collected_to;
|
88 | 116 | unsigned int slot = wreq->buffer.first_tail_slot;
|
89 | 117 |
|
| 118 | + if (WARN_ON_ONCE(!folioq)) { |
| 119 | + pr_err("[!] Writeback unlock found empty rolling buffer!\n"); |
| 120 | + netfs_dump_request(wreq); |
| 121 | + return; |
| 122 | + } |
| 123 | + |
90 | 124 | if (wreq->origin == NETFS_PGPRIV2_COPY_TO_CACHE) {
|
91 | 125 | if (netfs_pgpriv2_unlock_copied_folios(wreq))
|
92 | 126 | *notes |= MADE_PROGRESS;
|
|
0 commit comments