From: Livio Baldini Soares <livio@ime.usp.br>
To: linux-fsdevel@vger.kernel.org
Cc: neilb@cse.unsw.edu.au
Subject: Race with inodes in I_FREEING state
Date: Fri, 13 Jun 2003 00:44:45 -0300 [thread overview]
Message-ID: <20030613034445.GA8074@ime.usp.br> (raw)
Hello!
I'm developing a file system for Linux (I'm currently only using the
2.4 tree), and have seem to have hit a small race with the VFS code
starting to iget() an inode while it's being freed, which is causing
my code to panic.
The race occurs in the following scenario:
1) prune_icache() is called, and inode $x$ (ino = $z$) is removed from
the inode hash.
2) dispose_list() is called, but is preempted/scheduled.
3) Another task calls iget() for inode $y$ (ino also = $z$), doesn't
find it in the hash, and reads the inode (read_inode()).
4) dispose_list() wakes up, and finally calls FS-specific clear_inode()
operation on inode $x$.
It _is_ true that $x$ on steps 1 and 4 is a different inode than $y$
in step 3. However, my FS has some hashed/shared data, kept in 'union
u', which is deleted when clear_inode() is called. So, in the end of
step 4, inode $y$ has a broken 'u' field, pointing to deleted memory.
After looking around in the archive, I believe this race is similar
to the one described here, by Niel Brown:
http://marc.theaimsgroup.com/?l=linux-kernel&m=105235852013658&w=2
Does this not also happen in version 2.4.20? Can anybody tell me if
my logic is wrong, or if I'm just plain doing something stupid in my
FS?
Hope I have not troubled anyone, best regards,
--
Livio B. Soares
next reply other threads:[~2003-06-13 3:31 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2003-06-13 3:44 Livio Baldini Soares [this message]
2003-06-13 5:02 ` Race with inodes in I_FREEING state Neil Brown
2003-06-13 7:35 ` Andreas Dilger
2003-06-13 13:00 ` Livio Baldini Soares
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=20030613034445.GA8074@ime.usp.br \
--to=livio@ime.usp.br \
--cc=linux-fsdevel@vger.kernel.org \
--cc=neilb@cse.unsw.edu.au \
/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