CIFS 'cache=strict' breaks 'pv' utility

From: Jody - Tritech Computer Solutions
Date: Wed Feb 20 2013 - 11:40:19 EST


Greetings,

After the switch from 'cache=loose' to 'cache=strict' as the default CIFS cache mount option, I am unable to use the 'pv' utility in place of 'cat' to read files beyond a certain size over CIFS. Mounting with 'cache=loose' works around the problem, but does not change the breakage. If I mount with 'cache=strict' on 3.6.11 (the last stable kernel that works out-of-the-box) the breakage occurs again.

I hit this problem on 32-bit and 64-bit kernels, pv-1.2.0 and the latest pv-1.4.6, and the failure is tied to 'cache=strict' on all kernels from 3.6.11 through 3.8.

My testing with a command such as 'pv /mnt/cifs/file.tar.xz | wc -c' indicates that 'pv' outputs the data up to a certain power-of-two point and then fails with "pv: (stdin): read failed: Input/output error". I have seen data stop transferring at 524288, 1048576, and 2097152 bytes when I tried feeding it various file sizes.

I am able to use 'pv' with files on CIFS mounted as 'cache=strict' if I reduce the buffer size on the command line (the -B xxx option) to 131072 or lower, while setting a buffer of 262144 or higher always fails.

I am sending this to the LKML as well as the 'pv' maintainer, since I do not know the scope of the issue. If this exposes an unknown bug in the kernel CIFS driver, I don't want it to fly under the radar. I am available for testing and reporting as needed.

I don't subscribe to LKML, so please CC me on any responses.

--

Jody Lee Bruchon
Tritech Computer Solutions
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/