[LU-13985] seq_file next function must change *pos Created: 24/Sep/20 Updated: 12/Oct/20 Resolved: 12/Oct/20 |
|
| Status: | Resolved |
| Project: | Lustre |
| Component/s: | None |
| Affects Version/s: | None |
| Fix Version/s: | Lustre 2.14.0 |
| Type: | Bug | Priority: | Minor |
| Reporter: | Neil Brown | Assignee: | Neil Brown |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | None | ||
| Issue Links: |
|
||||||||||||||||
| Severity: | 3 | ||||||||||||||||
| Rank (Obsolete): | 9223372036854775807 | ||||||||||||||||
| Description |
|
If the .next function used to implement a seq_file ever doesn't change the value of *pos, the result of reading the file can be incorrect. This specifically includes when the end-of-file is found and NULL is returned. The error occurs if a 'read()' request is performed while the file pointer is in the middle of the last record, as you could happen if you seek there, or read a block that is not a whole number of records. In this case the remainder of the last record will be returned followed by a complete copy of that last record. To avoid the complete copy, *pos must be be changed so that a subsequent call to ->start reports an immediate end of file. There are several ->next functions in lustre which don't always change *pos.
|
| Comments |
| Comment by Gerrit Updater [ 24/Sep/20 ] |
|
Neil Brown (neilb@suse.de) uploaded a new patch: https://review.whamcloud.com/40035 |
| Comment by Gerrit Updater [ 12/Oct/20 ] |
|
Oleg Drokin (green@whamcloud.com) merged in patch https://review.whamcloud.com/40035/ |
| Comment by Peter Jones [ 12/Oct/20 ] |
|
Landed for 2.14 |