From 1a8b05264d1f390b7f5f4f5b2ffa25d24b13f0a2 Mon Sep 17 00:00:00 2001 From: robertmh Date: Mon, 21 Jan 2008 14:32:49 +0000 Subject: [PATCH] 2008-01-21 Robert Millan Fix detection of very small filesystems (like tar). * fs/reiserfs.c (grub_reiserfs_mount): When disk is too small to contain a ReiserFS, abort with GRUB_ERR_BAD_FS rather than GRUB_ERR_OUT_OF_RANGE (which made the upper layer think there's a problem with this disk). --- ChangeLog | 9 +++++++++ fs/reiserfs.c | 4 ++++ 2 files changed, 13 insertions(+) diff --git a/ChangeLog b/ChangeLog index d8ceb9999..31c349e8f 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,12 @@ +2008-01-21 Robert Millan + + Fix detection of very small filesystems (like tar). + + * fs/reiserfs.c (grub_reiserfs_mount): When disk is too small to + contain a ReiserFS, abort with GRUB_ERR_BAD_FS rather than + GRUB_ERR_OUT_OF_RANGE (which made the upper layer think there's + a problem with this disk). + 2008-01-21 Robert Millan * disk/i386/pc/biosdisk.c (grub_biosdisk_iterate): Add debug message diff --git a/fs/reiserfs.c b/fs/reiserfs.c index 328e2d7e2..bbd1b349a 100644 --- a/fs/reiserfs.c +++ b/fs/reiserfs.c @@ -691,6 +691,10 @@ grub_reiserfs_mount (grub_disk_t disk) return data; fail: + /* Disk is too small to contain a ReiserFS. */ + if (grub_errno == GRUB_ERR_OUT_OF_RANGE) + grub_error (GRUB_ERR_BAD_FS, "not a reiserfs filesystem"); + grub_free (data); return 0; }