Skip to contentSkip to conversation

Set return value to -EINVAL if superblock probe failed

PATCH New Laszlo Attila Toth 2 participants 2 messages Oct 12, 2009 – Oct 29, 2009 OCFS2

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Set return value to -EINVAL if superblock probe failed

In case of non-modular kernels the root filesystem is mounted by trying several filesystems. If ocfs2 is tried before the actual filesystem type, such as squashfs, the mount is failed because ocfs2_fill_super's return value was -EAGAIN and normally it should return with -EINVAL, which means the filesystem is non-ocfs2.

---
 fs/ocfs2/super.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)
fs/ocfs2/super.c +1 -0
index 476d488..1f506de 100644
@@ -621,6 +621,7 @@ static int ocfs2_fill_super(struct super_block *sb, void *data, int silent)
 	/* probe for superblock */
 	status = ocfs2_sb_probe(sb, &bh, &sector_size);
 	if (status < 0) {
+		status = -EINVAL;
 		mlog(ML_ERROR, "superblock probe failed!\n");
 		goto read_super_error;
 	}
Signature · 1 line
1.6.4.rc2
#1 lore raw

PATCH 1/1 Set return value to -EINVAL if superblock probe failed

Quoted 5 lines · Laszlo Attila Toth

In case of non-modular kernels the root filesystem is mounted by trying several filesystems. If ocfs2 is tried before the actual filesystem type, such as squashfs, the mount is failed because ocfs2_fill_super's return value was -EAGAIN and normally it should return with -EINVAL, which means the filesystem is non-ocfs2.

ocfs2_sb_probe() shouldn't be returning -EAGAIN in the first
place. I've done a different patch to the same effect, and it is now in the fixes branch of ocfs2.git.

Joel

Signature · 10 lines
"What does it say about a society's priorities when the time you
 spend in meetings on Monday is greater than the total number of
 hours you spent sleeping over the weekend?"
	- Nat Friedman

Joel Becker
Principal Software Developer
Oracle
E-mail: joel.becker at oracle.com
Phone: (650) 506-8127