From b61a0946e6223fd330f45aaf9d4f2e6d9bc83adb Mon Sep 17 00:00:00 2001 From: Al Smith Date: Thu, 27 May 1999 12:04:18 +0000 Subject: EFS updated to 1.0b. See http://aeschi.ch.eu.org/efs/HISTORY --- fs/efs/dir.c | 7 +++++++ fs/efs/super.c | 6 +++++- include/linux/efs_fs.h | 2 +- include/linux/efs_fs_i.h | 3 ++- include/linux/efs_fs_sb.h | 1 + 5 files changed, 16 insertions(+), 3 deletions(-) diff --git a/fs/efs/dir.c b/fs/efs/dir.c index ea8efd2dd..ea484dab4 100644 --- a/fs/efs/dir.c +++ b/fs/efs/dir.c @@ -109,6 +109,13 @@ static int efs_readdir(struct file *filp, void *dirent, filldir_t filldir) { /* copy filename and data in dirslot */ filldir(dirent, nameptr, namelen, filp->f_pos, inodenum); + /* sanity check */ + if (nameptr - (char *) dirblock + namelen > EFS_DIRBSIZE) { + printk(KERN_WARNING "EFS: directory entry %d exceeds directory block\n", slot); + slot++; + continue; + } + /* store position of next slot */ if (++slot == dirblock->slots) { slot = 0; diff --git a/fs/efs/super.c b/fs/efs/super.c index 2e370493d..b6ebde3de 100644 --- a/fs/efs/super.c +++ b/fs/efs/super.c @@ -119,11 +119,13 @@ static efs_block_t efs_validate_vh(struct volume_header *vh) { if (slice == -1) { printk(KERN_NOTICE "EFS: partition table contained no EFS partitions\n"); +#ifdef DEBUG } else { printk(KERN_INFO "EFS: using slice %d (type %s, offset 0x%x)\n", slice, (pt_entry->pt_name) ? pt_entry->pt_name : "unknown", sblock); +#endif } return(sblock); } @@ -178,12 +180,14 @@ struct super_block *efs_read_super(struct super_block *s, void *d, int silent) { bh = bread(dev, sb->fs_start + EFS_SUPER, EFS_BLOCKSIZE); if (!bh) { - printk(KERN_ERR "EFS: unable to read superblock\n"); + printk(KERN_ERR "EFS: cannot read superblock\n"); goto out_no_fs_ul; } if (efs_validate_super(sb, (struct efs_super *) bh->b_data)) { +#ifdef DEBUG printk(KERN_WARNING "EFS: invalid superblock at block %u\n", sb->fs_start + EFS_SUPER); +#endif brelse(bh); goto out_no_fs_ul; } diff --git a/include/linux/efs_fs.h b/include/linux/efs_fs.h index 6ae6f620e..1e5fd23cd 100644 --- a/include/linux/efs_fs.h +++ b/include/linux/efs_fs.h @@ -9,7 +9,7 @@ #ifndef __EFS_FS_H__ #define __EFS_FS_H__ -#define EFS_VERSION "1.0" +#define EFS_VERSION "1.0b" static const char cprt[] = "EFS: "EFS_VERSION" - (c) 1999 Al Smith "; diff --git a/include/linux/efs_fs_i.h b/include/linux/efs_fs_i.h index de55021ad..453d706ca 100644 --- a/include/linux/efs_fs_i.h +++ b/include/linux/efs_fs_i.h @@ -29,7 +29,8 @@ typedef union extent_u { typedef struct edevs { short odev; - unsigned int ndev; + short dev_filler; /* force ndev to start */ + unsigned int ndev; /* on a 32-bit boundary */ } efs_devs; /* diff --git a/include/linux/efs_fs_sb.h b/include/linux/efs_fs_sb.h index 21d01d0d4..95476663c 100644 --- a/include/linux/efs_fs_sb.h +++ b/include/linux/efs_fs_sb.h @@ -31,6 +31,7 @@ struct efs_super { short fs_heads; /* heads per cylinder */ short fs_ncg; /* # of cylinder groups in filesystem */ short fs_dirty; /* fs needs to be fsck'd */ + short fs_filler; /* force fs_time to start 2bytes later*/ int32_t fs_time; /* last super-block update */ int32_t fs_magic; /* magic number */ char fs_fname[6]; /* file system name */ -- cgit v1.2.3