From: Dmitry Monakhov <dmonakhov@openvz.org>
To: Theodore Ts'o <tytso@mit.edu>
Cc: linux-ext4@vger.kernel.org, wenqing.lz@taobao.com
Subject: Re: [PATCH 2/2] ext4: fix cpu_vs_disk conversions
Date: Wed, 03 Apr 2013 19:55:56 +0400 [thread overview]
Message-ID: <87txnnpq0j.fsf@openvz.org> (raw)
In-Reply-To: <20130403153742.GA14991@thunk.org>
On Wed, 3 Apr 2013 11:37:42 -0400, Theodore Ts'o <tytso@mit.edu> wrote:
> On Wed, Apr 03, 2013 at 02:58:31PM +0400, Dmitry Monakhov wrote:
> > diff --git a/fs/ext4/xattr.c b/fs/ext4/xattr.c
> > index 3a120b2..34da740 100644
> > --- a/fs/ext4/xattr.c
> > +++ b/fs/ext4/xattr.c
> > @@ -123,16 +123,15 @@ static __le32 ext4_xattr_block_csum(struct inode *inode,
> > {
> > struct ext4_sb_info *sbi = EXT4_SB(inode->i_sb);
> > __u32 csum, old;
> > -
> > - old = hdr->h_checksum;
> > + __le64 dsk_block_nr = cpu_to_le64(block_nr);
> > + old = le32_to_cpu(hdr->h_checksum);
>
> We're just saving and restoring hdr->h_checksum. So instead of
> byte-swapping the checksum in old, and then swapping it back, why not
> just do this instead:
>
> __le32 old;
>
> old = hdr->h_checksum;
> ...
> hdr->h_checksum = old;
yes. obviously that is correct.
>
> - Ted
> --
> To unsubscribe from this list: send the line "unsubscribe linux-ext4" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
next prev parent reply other threads:[~2013-04-03 15:56 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-04-03 10:58 [PATCH 1/2] ext4: fix usless declarations Dmitry Monakhov
2013-04-03 10:58 ` [PATCH 2/2] ext4: fix cpu_vs_disk conversions Dmitry Monakhov
2013-04-03 12:33 ` Theodore Ts'o
2013-04-03 12:58 ` Dmitry Monakhov
2013-04-03 13:04 ` Zheng Liu
2013-04-03 16:01 ` Theodore Ts'o
2013-04-03 15:37 ` Theodore Ts'o
2013-04-03 15:55 ` Dmitry Monakhov [this message]
2013-04-04 14:42 ` Dmitry Monakhov
2013-04-10 4:01 ` Theodore Ts'o
2013-04-10 4:02 ` [PATCH 1/3] ext4: fix big-endian bug in extent migration code Theodore Ts'o
2013-04-10 4:02 ` [PATCH 2/3] ext4: fix big-endian bug in metadata checksum calculations Theodore Ts'o
2013-04-10 4:02 ` [PATCH 3/3] ext4: fix miscellaneous big endian warnings Theodore Ts'o
2013-04-03 12:26 ` [PATCH 1/2] ext4: fix usless declarations Theodore Ts'o
2013-04-03 12:31 ` Dmitry Monakhov
2013-04-10 2:50 ` [1/2] " Theodore Ts'o
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=87txnnpq0j.fsf@openvz.org \
--to=dmonakhov@openvz.org \
--cc=linux-ext4@vger.kernel.org \
--cc=tytso@mit.edu \
--cc=wenqing.lz@taobao.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 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.