From patchwork Sun Jun 3 16:34:53 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Philipp Psurek X-Patchwork-Id: 10445479 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id BB7EF601BC for ; Sun, 3 Jun 2018 16:35:45 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 9C112289F7 for ; Sun, 3 Jun 2018 16:35:45 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 8EF1128B08; Sun, 3 Jun 2018 16:35:45 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.8 required=2.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI, T_DKIM_INVALID, T_TVD_MIME_EPI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 285AB289F7 for ; Sun, 3 Jun 2018 16:35:45 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751214AbeFCQfd (ORCPT ); Sun, 3 Jun 2018 12:35:33 -0400 Received: from mail-wm0-f47.google.com ([74.125.82.47]:40871 "EHLO mail-wm0-f47.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751368AbeFCQe6 (ORCPT ); Sun, 3 Jun 2018 12:34:58 -0400 Received: by mail-wm0-f47.google.com with SMTP id x2-v6so10308694wmh.5 for ; Sun, 03 Jun 2018 09:34:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=message-id:subject:from:to:date:in-reply-to:references:mime-version; bh=StK1JatPAjYDUKbFYDWP6+IVKAwn+RplO7x9lrrtEp8=; b=gKZsYXc2HVb25ynjLHtQNNXxNyPuK+TBzJH/gdgnt2RES8bQMSYAd6rJNUoZj7xYI2 fiT/YBkn2T/34M4D4WeJwYCEjsTZdr1Ukg3s9lv7UTcB3Ca6VmB+gp5AQ6Oos62uBKJr yOU5QRo7B3h8pUBIwCrh4Vst0S6w7HlurpPEYU0OQbXzD9F5rjyJm2c+/GQWwjzwF8c9 xUTtDJZ1ekdhArf8msHSQ+WMaQajCXXs45wwSlkEegy0ZoIAGMO+HKDJtz+GJr1VaH2b 6UIFjELaFqp+z8LHE3ES76C/sVr2MIUFgGs+YnEyc3CCFNCtQBpYZ5r4uy7AVzoagh+H Er3A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:message-id:subject:from:to:date:in-reply-to :references:mime-version; bh=StK1JatPAjYDUKbFYDWP6+IVKAwn+RplO7x9lrrtEp8=; b=bM9vHienJpnDgIc9MToEtP60g9Ip+MoqVmxnhE0uuCqBgTiiwYHPV4VE9DNxVjqc6d TNMcrMCj+vB+35+s/vWpod3rR1wJStLC3/92b4dtVnEg5Fzt/qc+0TwJ/aXy8ZoriM3F b2UM50Tno3JirVyNfqzbVdATawd+6fDqT6R+aiax8Dkq65yawKMPBQQFyF727kQdV9AW 73tZ4YmBZAQzdW3jKoxy5zErzuuQ+buwkXZWce/fXpu0zUGaMR8gaL3JYP8fYc4PxRvU 1I+v1yXsYzQARUEpyLTtcMCF2HLlmtdCBODCgl6A6Y8zc4mQWYWxaq2GArG1ALgGWLbM JDWA== X-Gm-Message-State: ALKqPwdYH7+wIJ8vuvc/c6Ijt4zE83W3DL43+s6RWUelrZjU0e4WRR1c K6UlpZVHQtPC0dtNmc9LD4WI1Q== X-Google-Smtp-Source: ADUXVKLPBcCnXfUPl8rQW6Ra0bOb9nBEQGwHFDfBldyRUfvIobuc/Pm4G1vB9AEQhchIlxebmosFyQ== X-Received: by 2002:a1c:7192:: with SMTP id d18-v6mr6931504wmi.115.1528043697671; Sun, 03 Jun 2018 09:34:57 -0700 (PDT) Received: from [192.168.25.210] (dslb-002-203-092-011.002.203.pools.vodafone-ip.de. [2.203.92.11]) by smtp.gmail.com with ESMTPSA id e188-v6sm10296286wmf.21.2018.06.03.09.34.56 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Sun, 03 Jun 2018 09:34:56 -0700 (PDT) Message-ID: <1528043693.3598.6.camel@gmail.com> Subject: Re: tools/locktest/testlk.c:84: argument 4 has type =?UTF-8?Q?=E2=80=98=5F=5Foff64=5Ft?= {aka long long =?UTF-8?Q?int}=E2=80=99?= From: Philipp Psurek To: linux-nfs@vger.kernel.org Date: Sun, 03 Jun 2018 18:34:53 +0200 In-Reply-To: <1528043420.3598.4.camel@gmail.com> References: <1528043420.3598.4.camel@gmail.com> X-Mailer: Evolution 3.24.6 Mime-Version: 1.0 Sender: linux-nfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-nfs@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Hi again, i see, email likes also no tabs. Patch as attachment. best regards Philipp fl.l_start and fl.l_len are 64 bit wide. It has been assumed that long is 64 bit in a printf(), which is incorrect on a 32 bit archtecture * 1st change suppress fall through warning from gcc-7 and higher * 2nd change removes whitespace * 3rd change is this bug and changes this into a long long Signed-off-by: Philipp Psurek --- --- a/tools/locktest/testlk.c 2018-05-22 20:33:01.000000000 +0200 +++ b/tools/locktest/testlk.c 2018-06-03 17:26:36.800202901 +0200 @@ -28,6 +28,7 @@ switch (c) { case 'h': usage(0); + /* fall through */ case 'r': cmd = F_SETLK; typ = F_RDLCK; @@ -75,13 +76,13 @@ if (fcntl(fd, cmd, &fl) < 0) fatal("fcntl"); printf("fcntl: ok\n"); - + /* printf("TP2\n"); */ if (cmd == F_GETLK) { if (fl.l_type == F_UNLCK) { printf("%s: no conflicting lock\n", fname); } else { - printf("%s: conflicting lock by %d on (%ld;%ld)\n", + printf("%s: conflicting lock by %d on (%lld;%lld)\n", fname, fl.l_pid, fl.l_start, fl.l_len); } return 0;