Note that sg_mmap_read does not parse the SCSI sense, so the script might fail for other reasons (some SCSI error) and think its a zero byte corruption. If you think an improved version could help (compare results within the program + parse senses) I can help. On Fri, Nov 25, 2016 at 10:07 AM, Johannes Thumshirn <jthumshirn@xxxxxxx> wrote: > On Wed, Nov 23, 2016 at 03:22:04PM -0500, Ewan Milne wrote: > > [...] > >> --- >> >> In other words, this commit made the bad behavior go away in 4.8. >> Need to look at this in more detail, it doesn't appear as if this patch >> was intended to fix such a problem. >> >> -Ewan > > Are you sure it did? I can repropduce copy_to_user() errors with 4.8 as well. > Using the very same reproducer. On 4.8 it's just harder to trigger and > doesn't trigger on AHCI as fas as I can telli (maybe I just haven't hit > it hard enough). I can trigger it on QEMUs SCSI CDROM emulation and hpsa > though. I cannot however trigger this with a minimal config inside an initrd. > > > Here's my test: > > --- 8< --- > #!/bin/sh > > cleanup() > { > rm -f expect.txt > rm -f test.txt > } > > trap cleanup EXIT INT > > ./sg_mmap_read -d /dev/sg0 -l 0 | od -x > expect.txt > > for i in $(seq 1 5000); do > ./sg_mmap_read -d /dev/sg0 -l 0 | od -x > test.txt > diff expect.txt test.txt > /dev/null > if [ $? -ne 0 ]; then > echo "FAIL" > exit 1 > fi > done > > echo "PASS" > > --- >8 --- > > I added some trace_printk()s to sg.c and try to hunt it down. It'll be good to > know if anyone of you can reproduce it with the above script as well. > > Byte, > Johannes > -- > Johannes Thumshirn Storage > jthumshirn@xxxxxxx +49 911 74053 689 > SUSE LINUX GmbH, Maxfeldstr. 5, 90409 Nürnberg > GF: Felix Imendörffer, Jane Smithard, Graham Norton > HRB 21284 (AG Nürnberg) > Key fingerprint = EC38 9CAB C2C4 F25D 8600 D0D0 0393 969D 2D76 0850 -- To unsubscribe from this list: send the line "unsubscribe linux-scsi" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html