All of lore.kernel.org
 help / color / mirror / Atom feed
From: Vasily Averin <vvs@sw.ru>
To: "Artem B. Bityuckiy" <dedekind@infradead.org>,
	Christoph Hellwig <hch@lst.de>,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH] bugfix: two read_inode() calls without clear_inode() call between
Date: Fri, 05 Aug 2005 17:33:22 +0400	[thread overview]
Message-ID: <42F36AA2.7030807@sw.ru> (raw)

Hello,

Could you please explain me, why we need to wake up somebody right 
before freeing an inode? It seems for me, if somebody really wait on 
this inode, then they have a good chance to access already freed memory.

Thank you,
	Vasily Averin


diff --git a/fs/inode.c b/fs/inode.c
--- a/fs/inode.c
+++ b/fs/inode.c
@@ -282,6 +282,13 @@ static void dispose_list(struct list_hea
  		if (inode->i_data.nrpages)
  			truncate_inode_pages(&inode->i_data, 0);
  		clear_inode(inode);
+
+		spin_lock(&inode_lock);
+		hlist_del_init(&inode->i_hash);
+		list_del_init(&inode->i_sb_list);
+		spin_unlock(&inode_lock);
+
+		wake_up_inode(inode);
                 ^^^^^^^^^^^^^^^^^^^^
  		destroy_inode(inode);
  		nr_disposed++;
  	}

tree b4e0b69dbf3d2da69aa49423227a1da6036e9566
parent 168a9fd6a1bf91041adf9909f6c72cf747f0ca8c
author Artem B. Bityuckiy <dedekind@infradead.org>
committer Linus Torvalds <torvalds@g5.osdl.org>

Acked-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>


             reply	other threads:[~2005-08-05 13:28 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-08-05 13:33 Vasily Averin [this message]
2005-08-05 13:42 ` [PATCH] bugfix: two read_inode() calls without clear_inode() call between Miklos Szeredi

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=42F36AA2.7030807@sw.ru \
    --to=vvs@sw.ru \
    --cc=dedekind@infradead.org \
    --cc=hch@lst.de \
    --cc=linux-kernel@vger.kernel.org \
    /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.