Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
HACK: add debug prints
  • Loading branch information
Ablu authored and OpenEmbedded committed Aug 29, 2023
1 parent 5d68ecf commit 3880b9f
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 0 deletions.
1 change: 1 addition & 0 deletions fs/fuse/file.c
Expand Up @@ -940,6 +940,7 @@ static void fuse_readpages_end(struct fuse_mount *fm, struct fuse_args *args,

if (mapping) {
struct inode *inode = mapping->host;
pr_debug("virtio_fs: %s: inode: %d\n", __func__, inode->i_ino);

/*
* Short read means EOF. If file size is larger, truncate it
Expand Down
25 changes: 25 additions & 0 deletions fs/fuse/virtio_fs.c
Expand Up @@ -563,6 +563,7 @@ static void virtio_fs_request_complete(struct fuse_req *req,
struct fuse_args_pages *ap;
unsigned int len, i, thislen;
struct page *page;
char *to;

/*
* TODO verify that server properly follows FUSE protocol
Expand All @@ -587,6 +588,30 @@ static void virtio_fs_request_complete(struct fuse_req *req,
}
}

if (args->out_pages) {
len = args->out_args[args->out_numargs - 1].size;
ap = container_of(args, typeof(*ap), args);
for (i = 0; i < ap->num_pages; i++) {
thislen = ap->descs[i].length;
page = ap->pages[i];
pr_err("virtio_fs: page: %p\n", page);
if (page) {
to = kmap_local_page(page);

pr_err("virtio_fs: to: %p\n", to);
if (to) {
print_hex_dump_bytes("virtio_fs rsp:", DUMP_PREFIX_NONE, to, thislen);
flush_dcache_page(page);
kunmap_local(to);
} else {
pr_err("virtio_fs: mapping failed!\n");
}
} else {
pr_err("virtio_fs: no page?\n");
}
}
}

spin_lock(&fpq->lock);
clear_bit(FR_SENT, &req->flags);
spin_unlock(&fpq->lock);
Expand Down

0 comments on commit 3880b9f

Please sign in to comment.