osdc: restart read on truncate/discard
This can be reliably reproduced by reading a large file (~500MB) on a
ceph-fuse mount and then evicting the client.
Now we see in the logs:
2020-10-21T01:46:29.679+0000
7f00beffd700 10 objectcacher.object(
10000000000.
00000030/head) truncate object[
10000000000.
00000030/head oset 0x7f00a0006b08 wr 0/0] to 0
2020-10-21T01:46:29.679+0000
7f00beffd700 10 objectcacher.object(
10000000000.
00000030/head) restarting reads post-truncate
...
2020-10-21T01:46:29.762+0000
7f00bffff700 20 objectcacher.object(
10000000000.
00000030/head) map_read error bh[ 0x7f0070004e30
1048576~
3145728 0x7f008404a720 (0) v 0 error=-108] waiters = {}
2020-10-21T01:46:29.762+0000
7f00bffff700 10 objectcacher readx hit bh bh[ 0x7f0070004e30
1048576~
3145728 0x7f008404a720 (0) v 0 error=-108] waiters = {}
2020-10-21T01:46:29.762+0000
7f00bffff700 10 objectcacher readx has all buffers
2020-10-21T01:46:29.762+0000
7f00bffff700 20 objectcacher readx done 0x7f007c00a9b0 -108
...
2020-10-21T01:46:29.763+0000
7f0077fff700 3 client.4497 ll_read 0x7f0080023720
202637312~131072 = -108
Fixes: https://tracker.ceph.com/issues/46434
Signed-off-by: Patrick Donnelly <pdonnell@redhat.com>