Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit fb5cbe9e authored by Joel Becker's avatar Joel Becker
Browse files

ocfs2: Return -EINVAL when a device is not ocfs2.



In case of non-modular kernels the root filesystem is mounted by trying
several filesystems. If ocfs2 was tried before the actual filesystem
type, the mount would fail because ocfs2_sb_probe() returns -EAGAIN
instead of -EINVAL.  ocfs2 will now return -EINVAL properly.

Signed-off-by: default avatarJoel Becker <joel.becker@oracle.com>
Reported-by: default avatarLaszlo Attila Toth <panther@balabit.hu>
parent 964fe080
Loading
Loading
Loading
Loading
+9 −7
Original line number Diff line number Diff line
@@ -773,19 +773,21 @@ static int ocfs2_sb_probe(struct super_block *sb,
		if (tmpstat < 0) {
			status = tmpstat;
			mlog_errno(status);
			goto bail;
			break;
		}
		di = (struct ocfs2_dinode *) (*bh)->b_data;
		memset(stats, 0, sizeof(struct ocfs2_blockcheck_stats));
		spin_lock_init(&stats->b_lock);
		status = ocfs2_verify_volume(di, *bh, blksize, stats);
		if (status >= 0)
			goto bail;
		tmpstat = ocfs2_verify_volume(di, *bh, blksize, stats);
		if (tmpstat < 0) {
			brelse(*bh);
			*bh = NULL;
		if (status != -EAGAIN)
		}
		if (tmpstat != -EAGAIN) {
			status = tmpstat;
			break;
		}
	}

bail:
	return status;