Skip to content

Commit be3193e

Browse files
committed
9p: Fix read/write debug statements to report server reply
Previous conversion to iov missed these debug statements which would now always print the requested size instead of the actual server reply. Write also added a loop in a much older commit but we didn't report these, while reads do report each iteration -- it's more coherent to keep reporting all requests to server so move that at the same time. Fixes: 7f02464 ("9p: convert to advancing variant of iov_iter_get_pages_alloc()") Signed-off-by: Dominique Martinet <[email protected]> Message-ID: <[email protected]>
1 parent 7013482 commit be3193e

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

net/9p/client.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1583,7 +1583,7 @@ p9_client_read_once(struct p9_fid *fid, u64 offset, struct iov_iter *to,
15831583
received = rsize;
15841584
}
15851585

1586-
p9_debug(P9_DEBUG_9P, "<<< RREAD count %d\n", count);
1586+
p9_debug(P9_DEBUG_9P, "<<< RREAD count %d\n", received);
15871587

15881588
if (non_zc) {
15891589
int n = copy_to_iter(dataptr, received, to);
@@ -1609,9 +1609,6 @@ p9_client_write(struct p9_fid *fid, u64 offset, struct iov_iter *from, int *err)
16091609
int total = 0;
16101610
*err = 0;
16111611

1612-
p9_debug(P9_DEBUG_9P, ">>> TWRITE fid %d offset %llu count %zd\n",
1613-
fid->fid, offset, iov_iter_count(from));
1614-
16151612
while (iov_iter_count(from)) {
16161613
int count = iov_iter_count(from);
16171614
int rsize = fid->iounit;
@@ -1623,6 +1620,9 @@ p9_client_write(struct p9_fid *fid, u64 offset, struct iov_iter *from, int *err)
16231620
if (count < rsize)
16241621
rsize = count;
16251622

1623+
p9_debug(P9_DEBUG_9P, ">>> TWRITE fid %d offset %llu count %d (/%d)\n",
1624+
fid->fid, offset, rsize, count);
1625+
16261626
/* Don't bother zerocopy for small IO (< 1024) */
16271627
if (clnt->trans_mod->zc_request && rsize > 1024) {
16281628
req = p9_client_zc_rpc(clnt, P9_TWRITE, NULL, from, 0,
@@ -1650,7 +1650,7 @@ p9_client_write(struct p9_fid *fid, u64 offset, struct iov_iter *from, int *err)
16501650
written = rsize;
16511651
}
16521652

1653-
p9_debug(P9_DEBUG_9P, "<<< RWRITE count %d\n", count);
1653+
p9_debug(P9_DEBUG_9P, "<<< RWRITE count %d\n", written);
16541654

16551655
p9_req_put(clnt, req);
16561656
iov_iter_revert(from, count - written - iov_iter_count(from));

0 commit comments

Comments
 (0)