From patchwork Tue Nov 20 21:56:47 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Darrick J. Wong" X-Patchwork-Id: 10691301 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 9753816B1 for ; Tue, 20 Nov 2018 21:56:52 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 7791128801 for ; Tue, 20 Nov 2018 21:56:52 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 67720293DC; Tue, 20 Nov 2018 21:56:52 +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=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI, UNPARSEABLE_RELAY 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 03D4128801 for ; Tue, 20 Nov 2018 21:56:52 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1725946AbeKUI2J (ORCPT ); Wed, 21 Nov 2018 03:28:09 -0500 Received: from userp2130.oracle.com ([156.151.31.86]:48336 "EHLO userp2130.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725851AbeKUI2I (ORCPT ); Wed, 21 Nov 2018 03:28:08 -0500 Received: from pps.filterd (userp2130.oracle.com [127.0.0.1]) by userp2130.oracle.com (8.16.0.22/8.16.0.22) with SMTP id wAKLrY9m153534; Tue, 20 Nov 2018 21:56:49 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=subject : from : to : cc : date : message-id : in-reply-to : references : mime-version : content-type : content-transfer-encoding; s=corp-2018-07-02; bh=gkEbzt0X75mV0RTARNIfHdzBB/jgI6z3YXlukup5mf4=; b=OcFBjK8PftXAKSul93X89+LNigo4iRUCme94k3fWmViCgPOVCxxOejpgEHJadNjeVGza Ql7i4KtIA7FQVEnR69MJR/ruc37NRxknQ/O7n5s2iz0MNMWm+cCc7A65Xo9Ex2VWOLX7 6at3OjiFjRvx1oqeNSRPhn44LsH7n7+ZVKuqtvbuaPQI+bpBdQxfk9NblYaMk5qGh8cH 0jApL/2GEz8Zg458ZJUZoulRmg+D8z6cONRohnd2PSFz1hWFR0zMcK/bQWkFtCZK0DWr don+RomUCMBKw7WZprFjrhjmNO3kkXID6jXSBxklyBDn1y7toSbyJe5l2sDZgtWKXpPh WQ== Received: from aserv0021.oracle.com (aserv0021.oracle.com [141.146.126.233]) by userp2130.oracle.com with ESMTP id 2ntadtxdc5-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 20 Nov 2018 21:56:49 +0000 Received: from aserv0121.oracle.com (aserv0121.oracle.com [141.146.126.235]) by aserv0021.oracle.com (8.14.4/8.14.4) with ESMTP id wAKLumYX007265 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 20 Nov 2018 21:56:48 GMT Received: from abhmp0006.oracle.com (abhmp0006.oracle.com [141.146.116.12]) by aserv0121.oracle.com (8.14.4/8.13.8) with ESMTP id wAKLumh6029031; Tue, 20 Nov 2018 21:56:48 GMT Received: from localhost (/10.145.178.163) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Tue, 20 Nov 2018 13:56:47 -0800 Subject: [PATCH 01/10] fsx: shut up compiler warnings From: "Darrick J. Wong" To: guaneryu@gmail.com, darrick.wong@oracle.com Cc: linux-xfs@vger.kernel.org, fstests@vger.kernel.org Date: Tue, 20 Nov 2018 13:56:47 -0800 Message-ID: <154275100761.8611.14831629844790867009.stgit@magnolia> In-Reply-To: <154275100143.8611.10235098565750994724.stgit@magnolia> References: <154275100143.8611.10235098565750994724.stgit@magnolia> User-Agent: StGit/0.17.1-dirty MIME-Version: 1.0 X-Proofpoint-Virus-Version: vendor=nai engine=5900 definitions=9083 signatures=668683 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 suspectscore=0 malwarescore=0 phishscore=0 bulkscore=0 spamscore=0 mlxscore=0 mlxlogscore=999 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1810050000 definitions=main-1811200192 Sender: fstests-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: fstests@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Darrick J. Wong Fix unused variables and potential filename overflows in fsx. Signed-off-by: Darrick J. Wong --- ltp/fsx.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/ltp/fsx.c b/ltp/fsx.c index b0157ba3..5601c70c 100644 --- a/ltp/fsx.c +++ b/ltp/fsx.c @@ -121,7 +121,7 @@ char *bname; /* basename of our test file */ char *logdev; /* -i flag */ char *logid; /* -j flag */ char dname[1024]; /* -P flag */ -char goodfile[1024]; +char goodfile[PATH_MAX]; int dirpath = 0; /* -P flag */ int fd; /* fd for our test file */ @@ -185,7 +185,7 @@ const char *replayops = NULL; const char *recordops = NULL; FILE * fsxlogf = NULL; FILE * replayopsf = NULL; -char opsfile[1024]; +char opsfile[PATH_MAX]; int badoff = -1; int closeopen = 0; @@ -541,13 +541,13 @@ mark_log(void) void dump_fsync_buffer(void) { - char fname_buffer[1024]; + char fname_buffer[PATH_MAX]; int good_fd; if (!good_buf) return; - snprintf(fname_buffer, 1024, "%s%s.mark%d", dname, + snprintf(fname_buffer, sizeof(fname_buffer), "%s%s.mark%d", dname, bname, mark_nr); good_fd = open(fname_buffer, O_WRONLY|O_CREAT|O_TRUNC, 0666); if (good_fd < 0) { @@ -1865,7 +1865,7 @@ main(int argc, char **argv) { int i, style, ch; char *endp, *tmp; - char logfile[1024]; + char logfile[PATH_MAX]; struct stat statbuf; int o_flags = O_RDWR|O_CREAT|O_TRUNC;