diff options
author | Li Zefan <lizf@cn.fujitsu.com> | 2011-11-28 16:43:00 +0800 |
---|---|---|
committer | David Sterba <dsterba@suse.cz> | 2011-11-30 18:46:05 +0100 |
commit | b772a86ea6d932ac29d5e50e67c977653c832f8a (patch) | |
tree | c142daf34c910b496ce578dfb391a8ebd929652e /fs/ufs | |
parent | ece7d20e8be6730fbb29f4550de6b19b1a3a9387 (diff) |
Btrfs: fix oops when calling statfs on readonly device
To reproduce this bug:
# dd if=/dev/zero of=img bs=1M count=256
# mkfs.btrfs img
# losetup -r /dev/loop1 img
# mount /dev/loop1 /mnt
OOPS!!
It triggered BUG_ON(!nr_devices) in btrfs_calc_avail_data_space().
To fix this, instead of checking write-only devices, we check all open
deivces:
# df -h /dev/loop1
Filesystem Size Used Avail Use% Mounted on
/dev/loop1 250M 28K 238M 1% /mnt
Signed-off-by: Li Zefan <lizf@cn.fujitsu.com>
Diffstat (limited to 'fs/ufs')
0 files changed, 0 insertions, 0 deletions