From: Ben Gras Date: Wed, 26 Feb 2014 14:57:08 +0000 (+0100) Subject: PFS: when copy fails, don't change state X-Git-Tag: v3.3.0~409 X-Git-Url: http://zhaoyanbai.com/repos/html/static/gitweb.js?a=commitdiff_plain;h=8c277f99f46e448530ff10ed2cde9725d4ea2951;p=minix.git PFS: when copy fails, don't change state . makes it safe to transparently repeate i/o operation on EFAULT . needed for future re-issued i/o operation change in VFS Change-Id: Iea6b29f3bff19002dcd69b30569671768ac17e21 --- diff --git a/servers/pfs/read.c b/servers/pfs/read.c index 157ed67cb..342d0baf8 100644 --- a/servers/pfs/read.c +++ b/servers/pfs/read.c @@ -74,18 +74,19 @@ int fs_readwrite(message *fs_m_in, message *fs_m_out) if (r == OK) { position += (signed) nrbytes; /* Update position */ cum_io += nrbytes; - } - /* On write, update file size and access time. */ - if (rw_flag == WRITING) { - rip->i_size = position; - } else { - memmove(bp->b_data, bp->b_data+nrbytes, rip->i_size - nrbytes); - rip->i_size -= nrbytes; + /* On write, update file size and access time. */ + if (rw_flag == WRITING) { + rip->i_size = position; + } else { + memmove(bp->b_data, bp->b_data+nrbytes, rip->i_size - nrbytes); + rip->i_size -= nrbytes; + } + + if (rw_flag == READING) rip->i_update |= ATIME; + if (rw_flag == WRITING) rip->i_update |= CTIME | MTIME; } - if (rw_flag == READING) rip->i_update |= ATIME; - if (rw_flag == WRITING) rip->i_update |= CTIME | MTIME; fs_m_out->RES_NBYTES = (size_t) cum_io; fs_m_out->RES_SEEK_POS = rip->i_size;