generic_file_write code segment in 2.2.18
Quoted 6 lines · --- Andi Kleen
Quoted 1 line · Stephen C. Tweedie
No, because then you'd be skipping the
updatepage()call if wetook a
Quoted 3 lines
fault mid-copy after copying some data. That would imply you had dirtied the page cache without an
updatepage().
Quoted 7 lines
Quoted 1 line
The current behaviour should just result in a short IO, which
should
Quoted 1 line
be fine.
The problem is that the short write is not reported to the caller, even when only zero bytes are copied (the page is corrupted anyways though because cfu zeros the uncopied rest).
I think it will be reported to caller, because when cfu copies 0 bytes,
bytes -= copy_from_user(dest, buf, bytes);
will make 'bytes' zero. Since 'bytes' is 'zero' updatepage will not be called and status retains value '-EFAULT' and it breaks out of the while loop immediately.
Quoted 2 lines
-Andi
asang..
__________________________________________________
Do You Yahoo!?
Yahoo! Photos - Share your holiday photos online!
http://photos.yahoo.com/
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [email protected]
Please read the FAQ at http://www.tux.org/lkml/
Quoted 15 lines · Asang K Dani
Quoted 6 lines · --- Andi Kleen
Quoted 1 line · Stephen C. Tweedie
No, because then you'd be skipping the
updatepage()call if wetook a
Quoted 3 lines
fault mid-copy after copying some data. That would imply you had dirtied the page cache without an
updatepage().Quoted 7 lines
Quoted 1 line
The current behaviour should just result in a short IO, which
should
Quoted 1 line
be fine.
The problem is that the short write is not reported to the caller, even when only zero bytes are copied (the page is corrupted anyways though because cfu zeros the uncopied rest).
Quoted 8 lines
I think it will be reported to caller, because when cfu copies 0 bytes,
bytes -= copy_from_user(dest, buf, bytes);will make 'bytes' zero. Since 'bytes' is 'zero' updatepage will not be called and status retains value '
-EFAULT' and it breaks out of the while loop immediately.
Right for zero it is handled, but not for 1 byte copied but the rest zeroed (which is a severe IO error)
-Andi
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [email protected]
Please read the FAQ at http://www.tux.org/lkml/