]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
xfs: xfs_readsb needs to check for magic numbers
authorDave Chinner <dchinner@redhat.com>
Fri, 6 Jun 2014 06:00:43 +0000 (16:00 +1000)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 7 Jul 2014 01:59:11 +0000 (18:59 -0700)
commit008643fecc2f65accbaccc2f1b97cc56cb5bd42a
tree12fe3855fe5f11ba9391ae691518efb9ab3481a1
parentf1ee6ff83edd96a756b6c986d50a92e772bc5ed4
xfs: xfs_readsb needs to check for magic numbers

commit 556b8883cfac3d3203557e161ea8005f8b5479b2 upstream.

Commit daba542 ("xfs: skip verification on initial "guess"
superblock read") dropped the use of a verifier for the initial
superblock read so we can probe the sector size of the filesystem
stored in the superblock. It, however, now fails to validate that
what was read initially is actually an XFS superblock and hence will
fail the sector size check and return ENOSYS.

This causes probe-based mounts to fail because it expects XFS to
return EINVAL when it doesn't recognise the superblock format.

Reported-by: Plamen Petrov <plamen.sisi@gmail.com>
Tested-by: Plamen Petrov <plamen.sisi@gmail.com>
Signed-off-by: Dave Chinner <dchinner@redhat.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Dave Chinner <david@fromorbit.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
fs/xfs/xfs_mount.c