@@ -38,6 +38,7 @@ void pcs_sreq_complete(struct pcs_int_request *sreq)
* and, most likely, resubmit request.
*/
if (ireq_check_redo(sreq)) {
+ ireq_retry_inc(ireq);
if (sreq->type != PCS_IREQ_CUSTOM) {
map_notify_soft_error(sreq);
@@ -18,7 +18,7 @@ struct pcs_fuse_exec_ctx {
struct bio_vec inline_bvec[FUSE_MAX_PAGES_PER_REQ];
} io;
struct {
- unsigned retry_cnt;
+ atomic_t retry_cnt;
pcs_error_t last_err;
} ctl;
};
@@ -29,6 +29,16 @@ struct pcs_fuse_req {
struct pcs_fuse_exec_ctx exec; /* Zero initialized context */
};
+static inline void ireq_retry_inc(struct pcs_int_request *ireq)
+{
+ if (likely(!ireq->completion_data.parent && ireq->completion_data.priv)) {
+ struct pcs_fuse_req *r = ireq->completion_data.priv;
+ atomic_inc(&r->exec.ctl.retry_cnt);
+ return;
+ }
+ WARN_ON_ONCE(1);
+}
+
struct pcs_fuse_cluster {
struct pcs_cluster_core cc;
struct fuse_conn *fc;
@@ -2871,6 +2871,7 @@ static void pcs_flushreq_complete(struct pcs_int_request * sreq)
sreq->flags &= ~IREQ_F_ONCE;
spin_unlock(&m->lock);
+ ireq_retry_inc(ireq);
map_notify_error(m, sreq, &ioh->map_version, sreq->flushreq.csl);
pcs_deaccount_ireq(sreq, &sreq->error);
pcs_clear_error(&sreq->error);
@@ -137,6 +137,7 @@ noinline void pcs_ireq_queue_fail(struct list_head *queue, int error)
ireq_on_error(ireq);
if (!(ireq->flags & IREQ_F_FATAL)) {
+ ireq_retry_inc(ireq);
pcs_clear_error(&ireq->error);
FUSE_KTRACE(ireq->cc->fc, "requeue truncate(%d) %llu@" DENTRY_FMT, ireq->type,
This counter will be useful for displaying in requests statistics info. Signed-off-by: Pavel Butsykin <pbutsykin@virtuozzo.com> --- fs/fuse/kio/pcs/pcs_cluster.c | 1 + fs/fuse/kio/pcs/pcs_cluster.h | 12 +++++++++++- fs/fuse/kio/pcs/pcs_map.c | 1 + fs/fuse/kio/pcs/pcs_req.c | 1 + 4 files changed, 14 insertions(+), 1 deletion(-)