From patchwork Thu Dec 2 14:40:08 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Benny Halevy X-Patchwork-Id: 374751 X-Patchwork-Delegate: Trond.Myklebust@netapp.com Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter1.kernel.org (8.14.4/8.14.3) with ESMTP id oB2EeP63023025 for ; Thu, 2 Dec 2010 14:40:26 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757758Ab0LBOkN (ORCPT ); Thu, 2 Dec 2010 09:40:13 -0500 Received: from daytona.panasas.com ([67.152.220.89]:35717 "EHLO daytona.panasas.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1757743Ab0LBOkL (ORCPT ); Thu, 2 Dec 2010 09:40:11 -0500 Received: from fs1.bhalevy.com ([172.17.33.19]) by daytona.panasas.com with Microsoft SMTPSVC(6.0.3790.4675); Thu, 2 Dec 2010 09:40:09 -0500 From: Benny Halevy To: Jim Rees Cc: linux-nfs@vger.kernel.org Subject: [PATCH] SQUASHME: decorate truncated signatures with "..." Date: Thu, 2 Dec 2010 16:40:08 +0200 Message-Id: <1291300808-14568-1-git-send-email-bhalevy@panasas.com> X-Mailer: git-send-email 1.7.2.3 In-Reply-To: <4CF7A8F9.8010902@panasas.com> References: <4CF7A8F9.8010902@panasas.com> X-OriginalArrivalTime: 02 Dec 2010 14:40:10.0151 (UTC) FILETIME=[D21DCB70:01CB922E] Sender: linux-nfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-nfs@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.3 (demeter1.kernel.org [140.211.167.41]); Thu, 02 Dec 2010 14:40:26 +0000 (UTC) diff --git a/utils/blkmapd/device-process.c b/utils/blkmapd/device-process.c index 0584bf9..ea8b8ec 100644 --- a/utils/blkmapd/device-process.c +++ b/utils/blkmapd/device-process.c @@ -64,10 +64,12 @@ static char *pretty_sig(char *sig, uint32_t siglen) } sprintf(rs, "0x%0llx", sigval); } else { - if (siglen > sizeof rs - 1) - siglen = sizeof rs - 1; + if (siglen > sizeof rs - 4) { + siglen = sizeof rs - 4; + sprintf(&rs[siglen], "..."); + } else + rs[siglen] = '\0'; memcpy(rs, sig, siglen); - rs[siglen] = '\0'; } return rs; }