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)
committerDave Chinner <david@fromorbit.com>
Fri, 6 Jun 2014 06:00:43 +0000 (16:00 +1000)
commit556b8883cfac3d3203557e161ea8005f8b5479b2
treed928587238b976cd90ef90494769eab3af6f95c4
parent1f6d64829db78a7e1d63e15c9f48f0a5d2b5a679
xfs: xfs_readsb needs to check for magic numbers

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.

cc: <stable@vger.kernel.org>
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>
fs/xfs/xfs_mount.c