提交 201d11bb 编写于 作者: B bernard

[DFS] Fix file size issue

This issue causes fstat & lseek not correct.
上级 5a6ec7dc
......@@ -678,7 +678,9 @@ int nfs_write(struct dfs_fd *file, const void *buf, rt_size_t count)
total += bytes;
/* update current position */
file->pos = fd->offset;
/* todo: update file size */
/* update file size */
if (fd->size < fd->offset) fd->size = fd->offset;
file->size = fd->size;
}
xdr_free((xdrproc_t)xdr_WRITE3res, (char *)&res);
} while (count > 0);
......@@ -796,6 +798,7 @@ int nfs_open(struct dfs_fd *file)
/* set private file */
file->data = fp;
file->size = fp->size;
}
return 0;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册