mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Daniel Phillips <phillips@innominate.de>
To: linux-kernel@vger.kernel.org
Subject: SMP Race in brelse
Date: Fri, 2 Feb 2001 15:19:34 +0100	[thread overview]
Message-ID: <0102021907250D.15914@gimli> (raw)

There is a rare SMP race in brelse:

1138 void __brelse(struct buffer_head * buf)
1139 {
1140         if (atomic_read(&buf->b_count)) {
1141                 atomic_dec(&buf->b_count);
1142                 return;
1143         }
1144         printk("VFS: brelse: Trying to free free buffer\n");
1145 }

                cpu1                                 cpu2

Starting with buf->b_count = 1, if we have:

   if (atomic_read(&buf->b_count))
					 if (atomic_read(&buf->b_count))
       atomic_dec(&buf->b_count);
					      atomic_dec(&buf->b_count);

buf->b_count is now 0, but it should be -1, we fail to to report
an erroneous extra brelse.

-- 
Daniel
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
Please read the FAQ at http://www.tux.org/lkml/

             reply	other threads:[~2001-02-02 18:09 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-02-02 14:19 Daniel Phillips [this message]
2001-02-02 18:24 ` Tigran Aivazian

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=0102021907250D.15914@gimli \
    --to=phillips@innominate.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®