ocfs2: seq_file .next functions should increase position index
Get series with b4
b4 am [email protected]Versions newest first
- v2 Latest1 of 4 patches 2 repliesIn review
1 of 4 patches is in this archive. The cover letter announces 4.
Patches in v2 No applies recorded yet
| # | Subject and files | Size | Replies | Applied |
|---|---|---|---|---|
| 1/4 | lockres_seq_next should increase position index | +0 | 5 replies |
Reviews trailers per patch
No Reviewed-by, Acked-by or Tested-by trailers for v2 yet.
Cover letter [Ocfs2-devel] [PATCH v2 0/4] ocfs2: seq_file .next functions should increase position index
Looks good.
Jun, could you please help verify these changes and give your tested-by? Since I don't have ocfs2 cluster locally...
Thanks,
Joseph
Quoted 42 lines · Vasily Averin
v2: resend with improved patch description
In Aug 2018 NeilBrown noticed
commit1f4aace60b0e("fs/seq_file.c: simplifyseq_fileiteration code and interface") "Some ->next functions do not increment *pos when they return NULL... Note that such ->next functions are buggy and should be fixed.
A simple demonstration isdd if=/proc/swaps bs=1000 skip=1
Choose any block size larger than the size of
/proc/swaps. This will always show the whole last line of/proc/swaps"
/proc/swapsoutput was fixed recently, however there are lot of other affected files and 4 of them are related to ocfs2.Unfortunately I'm not familiar with ocfs2 and cannot verify the patches locally.
Usually you can observe following related problems:
- read after lseek beyond end of file, described above by NeilBrown "dd if=<AFFECTED_FILE> bs=1000 skip=1" will incorrectly generate whole last line- read after lseek on into middle of last line will output expected rest of last line but then repeat whole last line once again.
- If .show() function generates multi-line output following bash script will never finish.
$ q=;while read -r r;do echo "$((++q)) $r";done < AFFECTED_FILEVasily Averin (4):
lockres_seq_nextshould increase position indexocfs2_dlm_seq_nextshould increase position indexnst_seq_nextshould increase position indexsc_seq_nextshould increase position indexfs/ocfs2/cluster/netdebug.c | 2 ++ fs/ocfs2/dlm/dlmdebug.c | 1 + fs/ocfs2/dlmglue.c | 1 + 3 files changed, 4 insertions(+)