[Devel] [PATCH 1/3] fs/fuse kio: bring fuse ktraces to a common view

Pavel Butsykin pbutsykin at virtuozzo.com
Wed Dec 5 21:03:46 MSK 2018


Since the fuse client adds \n to each message and allows only a single message
view, let's bring these to a common view and remove all \n in FUSE_K* messages.

https://pmc.acronis.com/browse/VSTOR-18383

Signed-off-by: Pavel Butsykin <pbutsykin at virtuozzo.com>
---
 fs/fuse/kio/pcs/pcs_cs.c           |  2 +-
 fs/fuse/kio/pcs/pcs_fuse_kdirect.c |  2 +-
 fs/fuse/kio/pcs/pcs_map.c          |  2 +-
 fs/fuse/kio/pcs/pcs_req.c          |  2 +-
 fs/fuse/kio/pcs/pcs_rpc.c          | 10 +++++-----
 5 files changed, 9 insertions(+), 9 deletions(-)

diff --git a/fs/fuse/kio/pcs/pcs_cs.c b/fs/fuse/kio/pcs/pcs_cs.c
index 8ed1c8f91d99..659f05327009 100644
--- a/fs/fuse/kio/pcs/pcs_cs.c
+++ b/fs/fuse/kio/pcs/pcs_cs.c
@@ -703,7 +703,7 @@ static int cs_input(struct pcs_rpc *ep, struct pcs_msg *msg)
 		msg->done(msg);
 		return 0;
 	default:
-		FUSE_KLOG(cc_from_rpc(ep->eng)->fc, LOG_ERR, "Unsupported message type %u\n", h->type);
+		FUSE_KLOG(cc_from_rpc(ep->eng)->fc, LOG_ERR, "Unsupported message type %u", h->type);
 		return PCS_ERR_PROTOCOL;
 	}
 }
diff --git a/fs/fuse/kio/pcs/pcs_fuse_kdirect.c b/fs/fuse/kio/pcs/pcs_fuse_kdirect.c
index 3940d6c255ba..7bedb7f95486 100644
--- a/fs/fuse/kio/pcs/pcs_fuse_kdirect.c
+++ b/fs/fuse/kio/pcs/pcs_fuse_kdirect.c
@@ -1475,7 +1475,7 @@ void __kfuse_trace(struct fuse_conn * fc, unsigned long ip, const char * fmt, ..
 		if (ip)
 			__trace_puts(ip, buf, len);
 		else
-			pr_debug("%s", buf);
+			pr_debug("%s\n", buf);
 	}
 	put_cpu();
 }
diff --git a/fs/fuse/kio/pcs/pcs_map.c b/fs/fuse/kio/pcs/pcs_map.c
index ec00cf238b1c..aafd130ace28 100644
--- a/fs/fuse/kio/pcs/pcs_map.c
+++ b/fs/fuse/kio/pcs/pcs_map.c
@@ -1934,7 +1934,7 @@ static int pcs_cslist_submit_read(struct pcs_int_request *ireq, struct pcs_cs_li
 		WRITE_ONCE(csl->read_index, i);
 		WRITE_ONCE(csl->select_stamp, jiffies);
 
-		FUSE_KTRACE(ireq->cc->fc, "Selected read map " MAP_FMT " to CS" NODE_FMT "; is_seq=%d\n", MAP_ARGS(ireq->iochunk.map),
+		FUSE_KTRACE(ireq->cc->fc, "Selected read map " MAP_FMT " to CS" NODE_FMT "; is_seq=%d", MAP_ARGS(ireq->iochunk.map),
 		      NODE_ARGS(csl->cs[i].cslink.cs->id), is_seq);
 		pcs_flow_bind_cs(ireq->iochunk.flow, csl->cs[i].cslink.cs);
 	}
diff --git a/fs/fuse/kio/pcs/pcs_req.c b/fs/fuse/kio/pcs/pcs_req.c
index f60ad025af59..d989027463e6 100644
--- a/fs/fuse/kio/pcs/pcs_req.c
+++ b/fs/fuse/kio/pcs/pcs_req.c
@@ -139,7 +139,7 @@ noinline void pcs_ireq_queue_fail(struct list_head *queue, int error)
 			if (!(ireq->flags & IREQ_F_FATAL)) {
 				pcs_clear_error(&ireq->error);
 
-				FUSE_KTRACE(ireq->cc->fc, "requeue truncate(%d) %llu@" DENTRY_FMT "\n", ireq->type,
+				FUSE_KTRACE(ireq->cc->fc, "requeue truncate(%d) %llu@" DENTRY_FMT, ireq->type,
 				      (unsigned long long)ireq->truncreq.offset, DENTRY_ARGS(ireq->dentry));
 
 				ireq_delay(ireq);
diff --git a/fs/fuse/kio/pcs/pcs_rpc.c b/fs/fuse/kio/pcs/pcs_rpc.c
index f6b8aefe6884..a34b204476bd 100644
--- a/fs/fuse/kio/pcs/pcs_rpc.c
+++ b/fs/fuse/kio/pcs/pcs_rpc.c
@@ -565,7 +565,7 @@ struct pcs_msg *rpc_get_hdr(struct pcs_sockio * sio, u32 *msg_size)
 
 	/* Fatal stream format error */
 	if (h->len < sizeof(struct pcs_rpc_hdr) || h->len > ep->params.max_msg_size) {
-		FUSE_KLOG(cc_from_rpc(ep->eng)->fc, LOG_ERR, "Bad message header %u %u\n", h->len, h->type);
+		FUSE_KLOG(cc_from_rpc(ep->eng)->fc, LOG_ERR, "Bad message header %u %u", h->len, h->type);
 		return NULL;
 	}
 
@@ -580,12 +580,12 @@ struct pcs_msg *rpc_get_hdr(struct pcs_sockio * sio, u32 *msg_size)
 		next_input = rpc_work_input;
 		break;
 	default:
-		FUSE_KLOG(cc_from_rpc(ep->eng)->fc, LOG_ERR, "Received msg in bad state %u\n", ep->state);
+		FUSE_KLOG(cc_from_rpc(ep->eng)->fc, LOG_ERR, "Received msg in bad state %u", ep->state);
 		return NULL;
 	}
 
 	if (h->len > PAGE_SIZE) {
-		FUSE_KLOG(cc_from_rpc(ep->eng)->fc, LOG_ERR, "Received too big msg  %u\n", h->len);
+		FUSE_KLOG(cc_from_rpc(ep->eng)->fc, LOG_ERR, "Received too big msg  %u", h->len);
 		*msg_size = h->len;
 		return PCS_TRASH_MSG;
 	}
@@ -615,7 +615,7 @@ void pcs_rpc_connect(struct pcs_rpc * ep)
 	if (ep->state != PCS_RPC_UNCONN)
 		return;
 
-	FUSE_KTRACE(cc_from_rpc(ep->eng)->fc, "Connecting to node " NODE_FMT "\n", NODE_ARGS(ep->peer_id));
+	FUSE_KTRACE(cc_from_rpc(ep->eng)->fc, "Connecting to node " NODE_FMT, NODE_ARGS(ep->peer_id));
 
 	BUG_ON(!ep->ops->connect);
 	ep->ops->connect(ep);
@@ -749,7 +749,7 @@ static void calendar_work(struct work_struct *w)
 		struct pcs_rpc_hdr * h = (struct pcs_rpc_hdr *)msg_inline_head(msg);
 
 		(void)h;
-		FUSE_KTRACE(cc->fc, "killing msg to " PEER_FMT " type=%u xid=" XID_FMT " stage=%d tmo=%d exp=%ld rem=%ld\n",
+		FUSE_KTRACE(cc->fc, "killing msg to " PEER_FMT " type=%u xid=" XID_FMT " stage=%d tmo=%d exp=%ld rem=%ld",
 		      PEER_ARGS(msg->rpc), h->type, XID_ARGS(h->xid),
 		      msg->stage, msg->timeout,
 		      (long)(msg->start_time + msg->timeout - jiffies),
-- 
2.15.1



More information about the Devel mailing list