Commit 0cc380d
cifs: Fix copy_to_iter return value check
The return value of copy_to_iter() function will never be negative,
it is the number of bytes copied, or zero if nothing was copied.
Update the check to treat 0 as an error, and return -1 in that case.
Fixes: d08089f ("cifs: Change the I/O paths to use an iterator rather than a page list")
Acked-by: Tom Talpey <[email protected]>
Reviewed-by: David Howells <[email protected]>
Signed-off-by: Fushuai Wang <[email protected]>
Signed-off-by: Steve French <[email protected]>1 parent 68d2e2c commit 0cc380d
1 file changed
Lines changed: 5 additions & 5 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4736 | 4736 | | |
4737 | 4737 | | |
4738 | 4738 | | |
4739 | | - | |
| 4739 | + | |
4740 | 4740 | | |
4741 | 4741 | | |
4742 | 4742 | | |
| |||
4849 | 4849 | | |
4850 | 4850 | | |
4851 | 4851 | | |
4852 | | - | |
4853 | | - | |
4854 | | - | |
4855 | | - | |
| 4852 | + | |
| 4853 | + | |
| 4854 | + | |
| 4855 | + | |
4856 | 4856 | | |
4857 | 4857 | | |
4858 | 4858 | | |
| |||
0 commit comments