From b063c050df82b75fde3e7a3e57021fa11148f71c Mon Sep 17 00:00:00 2001 From: Alan Cox Date: Sat, 26 Dec 2015 23:01:29 +0000 Subject: [PATCH] inode.c: gcc 6809 workaround --- Kernel/inode.c | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/Kernel/inode.c b/Kernel/inode.c index aa8b63fd..d7b13d60 100644 --- a/Kernel/inode.c +++ b/Kernel/inode.c @@ -94,7 +94,10 @@ void readi(inoptr ino, uint8_t flag) brelse(bp); } - + /* Bletch */ +#if defined(__M6809__) + gcc_miscompile_workaround(); +#endif udata.u_base += amount; udata.u_offset += amount; if (ispipe && udata.u_offset >= 18 * BLKSIZE) @@ -173,6 +176,12 @@ void writei(inoptr ino, uint8_t flag) while (towrite) { amount = min(towrite, BLKSIZE - BLKOFF(udata.u_offset)); + if (udata.u_offset >> BLKOVERSIZE) { + udata.u_error = EFBIG; + ssig(udata.u_ptab, SIGXFSZ); + break; + } + if ((pblk = bmap(ino, udata.u_offset >> BLKSHIFT, 0)) == NULLBLK) @@ -279,8 +288,6 @@ inoptr rwsetup(bool is_read, uint8_t * flag) oftp->o_ptr = ino->c_node.i_size; /* Initialize u_offset from file pointer */ udata.u_offset = oftp->o_ptr; - /* FIXME: for 32bit we will need to check for overflow of the - file size here in the r/w inode code */ return (ino); } -- 2.34.1