diff --git a/lib/libufs/inode.c b/lib/libufs/inode.c index 863e71867da..bc4d99c6620 100644 --- a/lib/libufs/inode.c +++ b/lib/libufs/inode.c @@ -48,6 +48,9 @@ #include +_Static_assert(LIBUFS_MAXBSIZE >= MAXBSIZE, + "LIBUFS_MAXBSIZE must be at least MAXBSIZE"); + int getinode(struct uufsd *disk, union dinodep *dp, ino_t inum) { diff --git a/lib/libufs/libufs.h b/lib/libufs/libufs.h index bb92e082a87..b76d15b338b 100644 --- a/lib/libufs/libufs.h +++ b/lib/libufs/libufs.h @@ -29,6 +29,7 @@ #ifndef __LIBUFS_H__ #define __LIBUFS_H__ + #include /* @@ -38,6 +39,8 @@ */ #define LIBUFS_BUFALIGN 128 +#define LIBUFS_MAXBSIZE 65536 + /* * userland ufs disk. */ @@ -48,11 +51,11 @@ struct uufsd { } d_sbunion __aligned(LIBUFS_BUFALIGN); union { struct cg d_cg; /* cylinder group */ - char d_buf[MAXBSIZE]; /* cylinder group storage */ + char d_buf[LIBUFS_MAXBSIZE]; /* cylinder group storage */ } d_cgunion __aligned(LIBUFS_BUFALIGN); union { union dinodep d_ino[1]; /* inode block */ - char d_inos[MAXBSIZE]; /* inode block as buffer */ + char d_inos[LIBUFS_MAXBSIZE]; /* inode block as buffer */ } d_inosunion __aligned(LIBUFS_BUFALIGN); const char *d_name; /* disk name */ const char *d_error; /* human readable disk error */