btrfs-progs: don't use closed fd
authorEric Sandeen <sandeen@redhat.com>
Fri, 25 Jan 2013 00:18:50 +0000 (18:18 -0600)
committerZach Brown <zab@redhat.com>
Wed, 6 Feb 2013 00:09:41 +0000 (16:09 -0800)
commita2eec48a8e863e34715cb111b5f578e58d728b7c
tree8aa5d2f0aaa4a313aec0d8ed3efb02d63d5d6c7d
parent6bd3a02fa67369c8a53c1b457e72c7330cfef3af
btrfs-progs: don't use closed fd

In the case that btrfs scrub cancel is given a device name,
we close the file handle, and then pass it to check_mounted_where()
which eventually preads from that (now closed) fd.  Fix the logic
so that we close & re-open the discovered mountpoint properly.

Signed-off-by: Eric Sandeen <sandeen@redhat.com>
Signed-off-by: Zach Brown <zab@redhat.com>
cmds-scrub.c