All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Darrick J. Wong" <darrick.wong@oracle.com>
To: guaneryu@gmail.com, darrick.wong@oracle.com
Cc: linux-xfs@vger.kernel.org, fstests@vger.kernel.org
Subject: [PATCH 01/10] fsx: shut up compiler warnings
Date: Tue, 20 Nov 2018 13:56:47 -0800	[thread overview]
Message-ID: <154275100761.8611.14831629844790867009.stgit@magnolia> (raw)
In-Reply-To: <154275100143.8611.10235098565750994724.stgit@magnolia>

From: Darrick J. Wong <darrick.wong@oracle.com>

Fix unused variables and potential filename overflows in fsx.

Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
---
 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;
 

  reply	other threads:[~2018-11-21  8:28 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-11-20 21:56 [PATCH v2 00/10] xfstests: add copy/dedupe/clone to fsx/fsstress Darrick J. Wong
2018-11-20 21:56 ` Darrick J. Wong [this message]
2018-11-20 21:56 ` [PATCH 02/10] fsx: always check buffer after each operation Darrick J. Wong
2018-11-21  1:18   ` Darrick J. Wong
2018-11-22  2:15   ` Darrick J. Wong
2018-11-20 21:56 ` [PATCH 03/10] fsx: use an enum to define the operation commands Darrick J. Wong
2018-11-20 21:57 ` [PATCH 04/10] fsx: add five-argument logging function Darrick J. Wong
2018-11-20 21:57 ` [PATCH 05/10] fsx: add clone range Darrick J. Wong
2018-11-22  2:14   ` Darrick J. Wong
2018-11-20 21:57 ` [PATCH 06/10] fsx: add FIDEDUPERANGE support Darrick J. Wong
2018-11-20 21:57 ` [PATCH 07/10] fsstress: add copy_file_range support Darrick J. Wong
2018-11-20 21:57 ` [PATCH 08/10] fsx: " Darrick J. Wong
2018-11-20 21:57 ` [PATCH 09/10] fsx: clean up copy/dedupe file range support Darrick J. Wong
2018-11-20 21:57 ` [PATCH 10/10] common/dump: disable copyrange Darrick J. Wong
2018-11-21 18:38 ` [PATCH 11/10] generic: long fsx soak tests Darrick J. Wong
2018-12-10 17:30 ` [PATCH v2 00/10] xfstests: add copy/dedupe/clone to fsx/fsstress Luis Henriques
2018-12-12  4:58   ` Darrick J. Wong
2018-12-12 11:19     ` Luis Henriques

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=154275100761.8611.14831629844790867009.stgit@magnolia \
    --to=darrick.wong@oracle.com \
    --cc=fstests@vger.kernel.org \
    --cc=guaneryu@gmail.com \
    --cc=linux-xfs@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.