All of lore.kernel.org
 help / color / mirror / Atom feed
From: Olaf Kirch <okir@lst.de>
To: dm-devel@redhat.com, Alasdair G Kergon <agk@redhat.com>,
	Andrew Morton <akpm@linux-foundation.org>
Subject: [PATCH 0/3] Fix SMP races in dm-crypt
Date: Wed, 21 Mar 2007 08:06:29 +0100	[thread overview]
Message-ID: <200703210806.30499.okir@lst.de> (raw)

(I'm resending this, because it seems mailman ate this posting
the first time around - apologies if you're seeing this twice).

I investigated kernel Bug 5948 (Oops when accessing SATA with device mapper on
AMD 64 X2) to help cut down on the number of open bugs.

The problem reported in that bug seems to be caused by memory pressure
when writing - crypt_alloc_buffer can return less than the full number of
pages required. In that case, the bio is split, but we're keeping a pointer
to the first chunk of the request around in first_clone, and copy it. If the
first clone completes I/O while we're cloning it, we oops on garbage in
the bvec.

I was able to reproduce this on 2.6.20 - and the following patches
seem to fix it for me.

dm-crypt-clone_init-early
	We need to call clone_init early on, before we can conceivably
	ever call bio_put on the clone

dm-crypt-clone-race
	Do no access bios after generic_make_request

dm-crypt-drop-first_clone
	Drop the first_clone business, and always allocate a fresh bio.

Olaf
-- 
Olaf Kirch  |  --- o --- Nous sommes du soleil we love when we play
okir@lst.de |    / | \   sol.dhoop.naytheet.ah kin.ir.samse.qurax

             reply	other threads:[~2007-03-21  7:06 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-03-21  7:06 Olaf Kirch [this message]
2007-03-21 10:03 ` [PATCH 0/3] Fix SMP races in dm-crypt Alasdair G Kergon
2007-03-21 10:47   ` [PATCH 4/3] Allocate smaller clones Olaf Kirch
2007-03-21 13:32   ` Re: [PATCH 0/3] Fix SMP races in dm-crypt Jim Meyering
2007-03-21 15:44     ` Alasdair G Kergon
2007-03-22 20:28 ` Christophe Saout
2007-03-22 20:41   ` Andrew Morton
2007-03-22 20:51     ` Christophe Saout
2007-03-22 21:53     ` Alasdair G Kergon
2007-03-22 22:44       ` Andrew Morton
  -- strict thread matches above, loose matches on Subject: below --
2007-03-20 19:54 Olaf Kirch

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=200703210806.30499.okir@lst.de \
    --to=okir@lst.de \
    --cc=agk@redhat.com \
    --cc=akpm@linux-foundation.org \
    --cc=dm-devel@redhat.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 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.