public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Andrew Morton <akpm@digeo.com>
To: Nikita Danilov <Nikita@Namesys.COM>
Cc: Linus Torvalds <Torvalds@Transmeta.COM>,
	Linux Kernel Mailing List <Linux-Kernel@vger.kernel.org>
Subject: Re: missed inode->i_hash cleanup in prune_icache()
Date: Fri, 27 Dec 2002 03:13:35 -0800	[thread overview]
Message-ID: <3E0C35DF.2801AA43@digeo.com> (raw)
In-Reply-To: 15884.10772.44042.51586@laputa.namesys.com

Nikita Danilov wrote:
> 
> Hello,
> 
> fs/inode.c:prune_icache() does list_del(&inode->i_hash), and then calls
> destroy_inode(). Inode is returned to the slab with ->i_hash still
> containing dangling pointers. Probably this wasn't observed so far,
> because prune_icache() is called during memory pressure and slab page
> where inode is returned back into, is almost immediately released.
> 
> 2.4 explicitly calls INIT_LIST_HEAD(&inode->i_hash) in prune_icache().
> 
> Following patch re-initializes ->i_hash.
> 
> Nikita.
> ===== fs/inode.c 1.84 vs edited =====
> --- 1.84/fs/inode.c     Mon Dec 16 09:38:48 2002
> +++ edited/fs/inode.c   Wed Dec 25 16:19:10 2002
> @@ -248,7 +248,7 @@
>                 struct inode *inode;
> 
>                 inode = list_entry(head->next, struct inode, i_list);
> -               list_del(&inode->i_list);
> +               list_del_init(&inode->i_list);
> 
>                 if (inode->i_data.nrpages)
>                         truncate_inode_pages(&inode->i_data, 0);
> 

That's i_list, not i_hash.

Yes, it's a bit sloppy to leave the i_list pointers dangling but
fs/inode.c:new_inode() will just overwrite i_list and all is well.

Could you please double-check or clarify the need for this change?

  reply	other threads:[~2002-12-27 11:05 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-12-27 10:23 missed inode->i_hash cleanup in prune_icache() Nikita Danilov
2002-12-27 11:13 ` Andrew Morton [this message]
2002-12-27 11:41   ` Nikita Danilov

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=3E0C35DF.2801AA43@digeo.com \
    --to=akpm@digeo.com \
    --cc=Linux-Kernel@vger.kernel.org \
    --cc=Nikita@Namesys.COM \
    --cc=Torvalds@Transmeta.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