]> git.karo-electronics.de Git - karo-tx-linux.git/commit
dm thin: fix stacked bi_next usage
authorJoe Thornber <ejt@redhat.com>
Wed, 28 Mar 2012 17:41:23 +0000 (18:41 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 2 Apr 2012 17:32:21 +0000 (10:32 -0700)
commit31f54d49f9550f8e80836cf6d41f38343fb49128
treea3a3dd2c5f465a3081b5ae998bd68de0d1e8d8b4
parentd4c95712f2d94b5098fc5ed53cceeb4d63103bdf
dm thin: fix stacked bi_next usage

commit 6f94a4c45a6f744383f9f695dde019998db3df55 upstream.

Avoid using the bi_next field for the holder of a cell when deferring
bios because a stacked device below might change it.  Store the
holder in a new field in struct cell instead.

When a cell is created, the bio that triggered creation (the holder) was
added to the same bio list as subsequent bios.  In some cases we pass
this holder bio directly to devices underneath.  If those devices use
the bi_next field there will be trouble...

This also simplifies some code that had to work out which bio was the
holder.

Signed-off-by: Joe Thornber <ejt@redhat.com>
Signed-off-by: Mike Snitzer <snitzer@redhat.com>
Signed-off-by: Alasdair G Kergon <agk@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/md/dm-thin.c