fix O_RDWR bug.
commit71974223e64327ab49c11a413eda1799d940f82c
authorGuanqun Lu <guanqun.lu@gmail.com>
Fri, 2 May 2008 13:51:53 +0000 (2 21:51 +0800)
committerGuanqun Lu <guanqun.lu@gmail.com>
Fri, 2 May 2008 13:51:53 +0000 (2 21:51 +0800)
tree00d7e542b2e872fb9a894f4ed47ec989cc6bed8f
parentb4b8abf36776f9cae8231ae697b6bbf53a845867
fix O_RDWR bug.

when you open a file with the flag O_RDWR, you can't write to that
file, because originally:
perm = PTE_P |PTE_U |PTE_SHARE;
if (o->o_mode & O_WRONLY)
perm |= PTE_W;
if o->o_mode is O_RDWR, then this 'if' statement is false,
then this page has no write permission, causing page fault.

Signed-off-by: Guanqun Lu <guanqun.lu@gmail.com>
fs/serv.c