public inbox for linux-xfs@vger.kernel.org
 help / color / mirror / Atom feed
From: Eric Sandeen <sandeen@sandeen.net>
To: xfs-oss <xfs@oss.sgi.com>
Subject: [PATCH] xfs_fsr: fix test for short write
Date: Thu, 17 Sep 2009 23:08:13 -0500	[thread overview]
Message-ID: <4AB307AD.9010904@sandeen.net> (raw)

Clang found this one too, as a dead nested assignment.

The point is to see if we write all the bytes; but the initial
assignment is backwards.  It's safe in the end, because if they
weren't already equal anyway, we'd have exited prior to this, but
it's worth fixing up for clarity.

Signed-of-by: Eric Sandeen <sandeen@sandeen.net>
---

clang record:
http://sandeen.net/clang/xfsprogs/2009-09-09-1/report-xOZEHP.html#EndPath

diff --git a/fsr/xfs_fsr.c b/fsr/xfs_fsr.c
index 9f2bf24..253a55d 100644
--- a/fsr/xfs_fsr.c
+++ b/fsr/xfs_fsr.c
@@ -1190,7 +1190,7 @@ packfile(char *fname, char *tname, int fd,
 			}
 			if (nfrags) {
 				/* Do a matching write to the tmp file */
-				wc = wc_b4;
+				wc_b4 = wc;
 				if (((wc = write(ffd, fbuf, wc)) != wc_b4)) {
 					fsrprintf(_("bad write of %d bytes "	
 						"to %s: %s\n"),

_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs

             reply	other threads:[~2009-09-18  4:06 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-09-18  4:08 Eric Sandeen [this message]
2009-09-22 12:03 ` [PATCH] xfs_fsr: fix test for short write Christoph Hellwig

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=4AB307AD.9010904@sandeen.net \
    --to=sandeen@sandeen.net \
    --cc=xfs@oss.sgi.com \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox