]> bbs.cooldavid.org Git - net-next-2.6.git/commit - fs/btrfs/volumes.c
Btrfs: Fix the multi-bio code to save the original bio for completion
authorChris Mason <chris.mason@oracle.com>
Tue, 5 Aug 2008 14:13:57 +0000 (10:13 -0400)
committerChris Mason <chris.mason@oracle.com>
Thu, 25 Sep 2008 15:04:06 +0000 (11:04 -0400)
commit7d2b4daa67379960477568abda62b8ba9ee3a8aa
treeaa24628bd7a0db2f827da77b86c9df94c19d6355
parentae01a0abf343aefe923ace5c1a8c634adfbe29c5
Btrfs: Fix the multi-bio code to save the original bio for completion

The multi-bio code is responsible for duplicating blocks in raid1 and
single spindle duplication.  It has counters to make sure all of
the locations for a given extent are properly written before io completion
is returned to the higher layers.

But, it didn't always complete the same bio it was given, sometimes a
clone was completed instead.  This lead to problems with the async
work queues because they saved a pointer to the bio in a struct off
bi_private.

The fix is to remember the original bio and only complete that one.

Signed-off-by: Chris Mason <chris.mason@oracle.com>
fs/btrfs/volumes.c
fs/btrfs/volumes.h