From: Dave Chinner <david@fromorbit.com>
To: xfs@oss.sgi.com
Subject: [PATCH 2/6] xfs_db: write command broken on 64 bit values
Date: Fri, 4 Jul 2014 15:57:11 +1000 [thread overview]
Message-ID: <1404453435-1915-3-git-send-email-david@fromorbit.com> (raw)
In-Reply-To: <1404453435-1915-1-git-send-email-david@fromorbit.com>
From: Dave Chinner <dchinner@redhat.com>
convert_args() has problesm with 64 bit fields because it tries to
shift them by 64 bits. The result of doing so is undefined by the C
standard, and so results in the unexpected behaviour of the result
being being the original value unchanged rather than 0. Hence you
can't write 64 bit fields because the code thinks that all values
other than 0 are out of range.
Signed-off-by: Dave Chinner <dchinner@redhat.com>
---
db/write.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/db/write.c b/db/write.c
index ca8bd0f..0157a44 100644
--- a/db/write.c
+++ b/db/write.c
@@ -565,7 +565,7 @@ convert_arg(
return NULL;
/* Does the value fit into the range of the destination bitfield? */
- if ((val >> bit_length) > 0)
+ if (bit_length < 64 && (val >> bit_length) > 0)
return NULL;
/*
* If the length of the field is not a multiple of a byte, push
--
2.0.0
_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs
next prev parent reply other threads:[~2014-07-04 5:57 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-07-04 5:57 [PATCH 0/6] xfsprogs: fixes for 3.2.1 Dave Chinner
2014-07-04 5:57 ` [PATCH 1/6] repair: support more than 25 ACLs Dave Chinner
2014-07-04 14:23 ` Christoph Hellwig
2014-07-04 5:57 ` Dave Chinner [this message]
2014-07-04 14:08 ` [PATCH 2/6] xfs_db: write command broken on 64 bit values Christoph Hellwig
2014-07-04 5:57 ` [PATCH 3/6] repair: handle directory block corruption in phase 6 Dave Chinner
2014-07-04 14:24 ` Christoph Hellwig
2014-07-04 5:57 ` [PATCH 4/6] libxfs: reused invalidated buffers leak state and data Dave Chinner
2014-07-04 14:15 ` Christoph Hellwig
2014-07-04 22:22 ` Dave Chinner
2014-07-05 9:48 ` Christoph Hellwig
2014-07-06 23:54 ` Dave Chinner
2014-07-07 0:09 ` Dave Chinner
2014-07-07 10:05 ` Christoph Hellwig
2014-07-04 5:57 ` [PATCH 5/6] repair: fix quota inode handling in secondary superblocks Dave Chinner
2014-07-04 14:35 ` Christoph Hellwig
2014-07-04 5:57 ` [PATCH 6/6] repair: get rid of BADFSINO Dave Chinner
2014-07-04 14:15 ` 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=1404453435-1915-3-git-send-email-david@fromorbit.com \
--to=david@fromorbit.com \
--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