diff --git a/fs/jfs/jfs_xtree.c b/fs/jfs/jfs_xtree.c index 2d304cee8..900f9dc77 100644 --- a/fs/jfs/jfs_xtree.c +++ b/fs/jfs/jfs_xtree.c @@ -619,6 +619,8 @@ int xtInsert(tid_t tid, /* transaction id */ (nextindex - index) * sizeof(xad_t)); /* insert the new entry: mark the entry NEW */ + if (index >= XTROOTMAXSLOT) + return -EINVAL; xad = &p->xad[index]; XT_PUTENTRY(xad, xflag, xoff, xlen, xaddr); diff --git a/fs/jfs/jfs_xtree.h b/fs/jfs/jfs_xtree.h index ad7592191..832e8a77d 100644 --- a/fs/jfs/jfs_xtree.h +++ b/fs/jfs/jfs_xtree.h @@ -61,7 +61,7 @@ struct xadlist { /* possible values for maxentry */ #define XTROOTINITSLOT_DIR 6 #define XTROOTINITSLOT 10 -#define XTROOTMAXSLOT 18 +#define XTROOTMAXSLOT 16 #define XTPAGEMAXSLOT 256 #define XTENTRYSTART 2