]> git.baikalelectronics.ru Git - kernel.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)
committerIlya Dryomov <idryomov@gmail.com>
Wed, 9 Nov 2011 20:53:39 +0000 (22:53 +0200)
commitccb219c4db1cdd286ec94dba2fdaefbb629111f1
treeda0cadb86766bbf34f30c4b3efddde01e3d6d677
parent3c661af0879736f751107f7343485d5dfefb7892
Btrfs: rework error handling in btrfs_mount()

Commits aaf64d2c and a23c3a3a 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>
fs/btrfs/super.c