Skip to content
Commit 4eedeb75 authored by Hisashi Hifumi's avatar Hisashi Hifumi Committed by Chris Mason
Browse files

Btrfs: pin buffers during write_dev_supers



write_dev_supers is called in sequence.  First is it called with wait == 0,
which starts IO on all of the super blocks for a given device.  Then it is
called with wait == 1 to make sure they all reach the disk.

It doesn't currently pin the buffers between the two calls, and it also
assumes the buffers won't go away between the two calls, leading to
an oops if the VM manages to free the buffers in the middle of the sync.

This fixes that assumption and updates the code to return an error if things
are not up to date when the wait == 1 run is done.

Signed-off-by: default avatarHisashi Hifumi <hifumi.hisashi@oss.ntt.co.jp>
Signed-off-by: default avatarChris Mason <chris.mason@oracle.com>
parent e5e9a520
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment