linux-ext4.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Johann Lombardi <johann.lombardi@bull.net>
To: Kalpak Shah <kalpak@clusterfs.com>
Cc: linux-ext4 <linux-ext4@vger.kernel.org>,
	Andreas Dilger <adilger@clusterfs.com>, tytso <tytso@mit.edu>,
	sct <sct@redhat.com>
Subject: Re: [RFC] [PATCH 1/1] Nanosecond timestamps
Date: Wed, 7 Feb 2007 21:50:28 +0100	[thread overview]
Message-ID: <20070207205028.GA13836@lombardij> (raw)
In-Reply-To: <1170427790.6464.6.camel@garfield>

On Fri, Feb 02, 2007 at 08:19:50PM +0530, Kalpak Shah wrote:
> +#define EXT3_INODE_SET_XTIME(xtime, extra_xtime, inode, raw_inode) \
> +do { \
> +       (raw_inode)->xtime = cpu_to_le32((inode)->xtime.tv_sec); \
> + \
> +       if (offsetof(typeof(*raw_inode), extra_xtime) - \
> +           offsetof(typeof(*raw_inode), i_extra_isize) + \
> +           sizeof((raw_inode)->extra_xtime) <= \
> +               le16_to_cpu((raw_inode)->i_extra_isize)) \
                               ^^^^^^^^^^^^^^^^^^^^^^^^^
> +               (raw_inode)->extra_xtime = \

With 128-byte inodes, raw_inode->i_extra_isize is beyond the inode limit
and the above will corrupt the filesystem.
IMO, i_extra_isize from ext3_inode_info should be used instead of
raw_inode->i_extra_isize.

> +#define EXT3_INODE_GET_XTIME(xtime, extra_xtime, inode, raw_inode) \
> +do { \
> +       (inode)->xtime.tv_sec = le32_to_cpu((raw_inode)->xtime); \
> + \
> +       if (offsetof(typeof(*raw_inode), extra_xtime) - \
> +           offsetof(typeof(*raw_inode), i_extra_isize) + \
> +           sizeof((raw_inode)->extra_xtime) <= \
> +           le16_to_cpu((raw_inode)->i_extra_isize)) { \
                           ^^^^^^^^^^^^^^^^^^^^^^^^^
ditto

Cheers,
Johann

  parent reply	other threads:[~2007-02-07 20:49 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-02-02 14:49 [RFC] [PATCH 1/1] Nanosecond timestamps Kalpak Shah
2007-02-06 15:12 ` Johann Lombardi
2007-02-07 20:39   ` Andreas Dilger
2007-02-07 21:05     ` Dave Kleikamp
2007-02-08 10:33       ` Johann Lombardi
2007-02-08 10:30     ` Johann Lombardi
2007-02-13 13:16   ` [PATCH Take2 " Kalpak Shah
2007-02-19  9:56     ` Johann Lombardi
2007-02-07 20:50 ` Johann Lombardi [this message]
  -- strict thread matches above, loose matches on Subject: below --
2007-02-02 14:39 [RFC] [PATCH 1/1] nanosecond timestamps Kalpak Shah
2007-02-06  4:09 ` Theodore Tso
2007-02-07 17:58   ` Andreas Dilger
2007-02-15 17:51   ` Theodore Tso
2007-02-25 10:36 ` Andrew Morton
2007-02-26 21:42   ` Andreas Dilger
2007-02-26 23:20     ` Dave Kleikamp
2007-02-27  0:11       ` Andreas Dilger

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=20070207205028.GA13836@lombardij \
    --to=johann.lombardi@bull.net \
    --cc=adilger@clusterfs.com \
    --cc=kalpak@clusterfs.com \
    --cc=linux-ext4@vger.kernel.org \
    --cc=sct@redhat.com \
    --cc=tytso@mit.edu \
    /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;
as well as URLs for NNTP newsgroup(s).