All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] xfs_fsr: fix test for short write
@ 2009-09-18  4:08 Eric Sandeen
  2009-09-22 12:03 ` Christoph Hellwig
  0 siblings, 1 reply; 2+ messages in thread
From: Eric Sandeen @ 2009-09-18  4:08 UTC (permalink / raw)
  To: xfs-oss

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

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] xfs_fsr: fix test for short write
  2009-09-18  4:08 [PATCH] xfs_fsr: fix test for short write Eric Sandeen
@ 2009-09-22 12:03 ` Christoph Hellwig
  0 siblings, 0 replies; 2+ messages in thread
From: Christoph Hellwig @ 2009-09-22 12:03 UTC (permalink / raw)
  To: Eric Sandeen; +Cc: xfs-oss

On Thu, Sep 17, 2009 at 11:08:13PM -0500, Eric Sandeen wrote:
> 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>

Looks good to me, 


Reviewed-by: Christoph Hellwig <hch@lst.de>

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

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2009-09-22 12:02 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-09-18  4:08 [PATCH] xfs_fsr: fix test for short write Eric Sandeen
2009-09-22 12:03 ` Christoph Hellwig

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.