Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

virtio_fs: fix the hash table using in virtio_fs_enqueue_req()

The original commit be2ff42c5d6e ("fuse: Use hash table to link
processing request") converted fuse_pqueue->processing to a hash table,
but virtio_fs_enqueue_req() was not updated to use it correctly.
So use fuse_pqueue->processing as a hash table, this make the code
more coherent

Co-developed-by: Fushuai Wang <wangfushuai@baidu.com>
Signed-off-by: Fushuai Wang <wangfushuai@baidu.com>
Signed-off-by: Li RongQing <lirongqing@baidu.com>
Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
Signed-off-by: Miklos Szeredi <mszeredi@redhat.com>

authored by

Li RongQing and committed by
Miklos Szeredi
7dbe6442 2841808f

+5 -2
+1
fs/fuse/dev.c
··· 323 323 { 324 324 return hash_long(unique & ~FUSE_INT_REQ_BIT, FUSE_PQ_HASH_BITS); 325 325 } 326 + EXPORT_SYMBOL_GPL(fuse_req_hash); 326 327 327 328 /* 328 329 * A new request is available, wake fiq->waitq
+4 -2
fs/fuse/virtio_fs.c
··· 20 20 #include <linux/cleanup.h> 21 21 #include <linux/uio.h> 22 22 #include "fuse_i.h" 23 + #include "fuse_dev_i.h" 23 24 24 25 /* Used to help calculate the FUSE connection's max_pages limit for a request's 25 26 * size. Parts of the struct fuse_req are sliced into scattergather lists in ··· 1382 1381 unsigned int out_sgs = 0; 1383 1382 unsigned int in_sgs = 0; 1384 1383 unsigned int total_sgs; 1385 - unsigned int i; 1384 + unsigned int i, hash; 1386 1385 int ret; 1387 1386 bool notify; 1388 1387 struct fuse_pqueue *fpq; ··· 1442 1441 1443 1442 /* Request successfully sent. */ 1444 1443 fpq = &fsvq->fud->pq; 1444 + hash = fuse_req_hash(req->in.h.unique); 1445 1445 spin_lock(&fpq->lock); 1446 - list_add_tail(&req->list, fpq->processing); 1446 + list_add_tail(&req->list, &fpq->processing[hash]); 1447 1447 spin_unlock(&fpq->lock); 1448 1448 set_bit(FR_SENT, &req->flags); 1449 1449 /* matches barrier in request_wait_answer() */