]> www.infradead.org Git - users/jedix/linux-maple.git/commit
Btrfs: rework error handling in btrfs_mount()
authorIlya Dryomov <idryomov@gmail.com>
Wed, 9 Nov 2011 12:41:22 +0000 (14:41 +0200)
committerChris Mason <chris.mason@oracle.com>
Wed, 16 Nov 2011 02:20:58 +0000 (21:20 -0500)
commitfcdc297d4e7c3f0b4966779c1dac063f77a24b59
tree9e537d994881e3066fc680cffeaaf08c3f32b769
parentc57950d775cd1127e775c24b253138d6b4e2a420
Btrfs: rework error handling in btrfs_mount()

Commits 6c41761f and 45ea6095 introduced the possibility of NULL pointer
dereference on error paths, also we would leave all devices busy and
leak fs_info with all sub-structures on error when trying to mount an
already mounted fs to a different directory.

Fix this by doing all allocations before trying to open any of the
devices, adjust error path for mount-already-mounted-fs case.

Signed-off-by: Ilya Dryomov <idryomov@gmail.com>
(cherry picked from commit 04d21a244fdf79d0ac892eaaa9a46b682467277c)
fs/btrfs/super.c