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
This commit is contained in:
parent
fa901649a3
commit
8c277f99f4
1 changed files with 11 additions and 10 deletions
|
@ -74,18 +74,19 @@ int fs_readwrite(message *fs_m_in, message *fs_m_out)
|
||||||
if (r == OK) {
|
if (r == OK) {
|
||||||
position += (signed) nrbytes; /* Update position */
|
position += (signed) nrbytes; /* Update position */
|
||||||
cum_io += nrbytes;
|
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;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (rw_flag == READING) rip->i_update |= ATIME;
|
||||||
|
if (rw_flag == WRITING) rip->i_update |= CTIME | MTIME;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* 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;
|
|
||||||
fs_m_out->RES_NBYTES = (size_t) cum_io;
|
fs_m_out->RES_NBYTES = (size_t) cum_io;
|
||||||
fs_m_out->RES_SEEK_POS = rip->i_size;
|
fs_m_out->RES_SEEK_POS = rip->i_size;
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue