[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-changelog] [xen-unstable] libfsimage: make pygrub work on ufs



# HG changeset patch
# User Keir Fraser <keir.fraser@xxxxxxxxxx>
# Date 1213020386 -3600
# Node ID db466cd3412c0c383b1a4a9f4a1952baa9ad42bc
# Parent  adf05a812edb5a9b4479cb8991102f7fa9c15e2f
libfsimage: make pygrub work on ufs
Signed-off-by: Christoph Egger <Christoph.Egger@xxxxxxx>
---
 tools/libfsimage/ufs/fsys_ufs.c |    6 ++++--
 1 files changed, 4 insertions(+), 2 deletions(-)

diff -r adf05a812edb -r db466cd3412c tools/libfsimage/ufs/fsys_ufs.c
--- a/tools/libfsimage/ufs/fsys_ufs.c   Mon Jun 09 15:05:18 2008 +0100
+++ b/tools/libfsimage/ufs/fsys_ufs.c   Mon Jun 09 15:06:26 2008 +0100
@@ -32,8 +32,9 @@
 #define SUPERBLOCK ((struct fs *)(FSYS_BUF + 0x2000))
 #define        INODE ((struct icommon *)(FSYS_BUF + 0x1000))
 #define DIRENT (FSYS_BUF + 0x4000)
+#define MAXBSIZE ((FSYS_BUFLEN - 0x4000) / 2)
 #define INDIRBLK1 ((grub_daddr32_t *)(FSYS_BUF + 0x4000)) /* 2+ indir blk */
-#define        INDIRBLK0 ((grub_daddr32_t *)(FSYS_BUF+ 0x6000))  /* 1st 
indirect blk */
+#define        INDIRBLK0 ((grub_daddr32_t *)(FSYS_BUF+ 0x4000 + MAXBSIZE))  /* 
1st indirect blk */
 
 #define        indirblk0 (*fsig_int1(ffi))
 #define        indirblk1 (*fsig_int2(ffi))
@@ -48,7 +49,8 @@ ufs_mount(fsi_file_t *ffi, const char *o
 {
        if (/*! IS_PC_SLICE_TYPE_SOLARIS(current_slice) || */
            !devread(ffi, UFS_SBLOCK, 0, UFS_SBSIZE, (char *)SUPERBLOCK) ||
-           SUPERBLOCK->fs_magic != UFS_MAGIC)
+           SUPERBLOCK->fs_magic != UFS_MAGIC ||
+           MAXBSIZE < SUPERBLOCK->fs_bsize)
                return 0;
 
        return 1;

_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-changelog


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.