]> git.baikalelectronics.ru Git - kernel.git/commit
Btrfs: deal with errors in write_dev_supers
authorJosef Bacik <jbacik@fusionio.com>
Mon, 29 Apr 2013 14:05:57 +0000 (10:05 -0400)
committerJosef Bacik <jbacik@fusionio.com>
Mon, 6 May 2013 19:55:22 +0000 (15:55 -0400)
commit3da0b0fdb8189a2b12c90beaadd31079f5827905
tree824cb5efa227ea42c325b2138e5b5c9dd0918b97
parent6d5abfaf821eeaf576eff5e0ccae91471c0ffee1
Btrfs: deal with errors in write_dev_supers

If you try to mount -o loop a restored file system it will panic if the file
ends up being smaller than the original disk.  This is because we go to try and
get a block for a super that may be past the EOF which makes __getblk return
NULL for a buffer head when we aren't expecting it to.  Fix this by dealing with
this case and just jacking up the errors count.  With this patch we no longer
panic when mounting a restored file system loopback.  Thanks,

Signed-off-by: Josef Bacik <jbacik@fusionio.com>
fs/btrfs/disk-io.c