All of lore.kernel.org
 help / color / mirror / Atom feed
From: Dave Jones <davej@redhat.com>
To: Linux Kernel Mailing List <linux-kernel@vger.kernel.org>
Cc: tytso@mit.edu
Subject: Re: ext4: cache all of an extent tree's leaf block upon reading
Date: Thu, 5 Sep 2013 10:37:49 -0400	[thread overview]
Message-ID: <20130905143749.GA15894@redhat.com> (raw)
In-Reply-To: <20130905013848.42DD7660EE1@gitolite.kernel.org>

On Thu, Sep 05, 2013 at 01:38:48AM +0000, Linux Kernel wrote:
 > Gitweb:     http://git.kernel.org/linus/;a=commit;h=107a7bd31ac003e42c0f966aa8e5b26947de6024
 > Commit:     107a7bd31ac003e42c0f966aa8e5b26947de6024
 > Parent:     3be78c73179c9347bdc0a92b2898063bd2300ff7
 > Author:     Theodore Ts'o <tytso@mit.edu>
 > AuthorDate: Fri Aug 16 21:23:41 2013 -0400
 > Committer:  Theodore Ts'o <tytso@mit.edu>
 > CommitDate: Fri Aug 16 21:23:41 2013 -0400
 > 
 >     ext4: cache all of an extent tree's leaf block upon reading
 

 > + * ext4_es_cache_extent() inserts information into the extent status
 > + * tree if and only if there isn't information about the range in
 > + * question already.
 > + */
 > +void ext4_es_cache_extent(struct inode *inode, ext4_lblk_t lblk,
 > +			  ext4_lblk_t len, ext4_fsblk_t pblk,
 > +			  unsigned int status)
 > +{
 > +	struct extent_status *es;
 > +	struct extent_status newes;
 > +	ext4_lblk_t end = lblk + len - 1;
 > +
 > +	newes.es_lblk = lblk;
 > +	newes.es_len = len;
 > +	ext4_es_store_pblock(&newes, pblk);


ext4_es_store_pblock or's the pblk with the existing contents of the struct member.
(albeit masked with ES_MASK)

Should there be a 

	newes.es_pblk = 0;

up there too ?

It seems like if the stack happened to contain any of ES_WRITTEN | ES_UNWRITTEN | ES_DELAYED | ES_HOLE
then it could leak through into the new extent status.

	Dave


       reply	other threads:[~2013-09-05 14:37 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20130905013848.42DD7660EE1@gitolite.kernel.org>
2013-09-05 14:37 ` Dave Jones [this message]
2013-09-05 14:53   ` ext4: cache all of an extent tree's leaf block upon reading Theodore Ts'o
2013-09-05 15:14     ` Dave Jones
2013-09-05 19:08       ` 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=20130905143749.GA15894@redhat.com \
    --to=davej@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --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 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.