Bug 1311395 - CIFS reads beyond end of file if 131072 is used as block size
CIFS reads beyond end of file if 131072 is used as block size
Product: Fedora
Classification: Fedora
Component: kernel (Show other bugs)
x86_64 Linux
unspecified Severity high
: ---
: ---
Assigned To: Kernel Maintainer List
Fedora Extras Quality Assurance
: Reopened
Depends On:
  Show dependency treegraph
Reported: 2016-02-24 02:37 EST by Sai Ho Lui
Modified: 2016-10-10 20:43 EDT (History)
15 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2016-10-10 20:42:35 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)
Compressed output of "strace cp file1 file2 2> out" (3.00 KB, application/x-gzip)
2016-06-23 05:49 EDT, Esa Varemo
no flags Details
Compressed output of "strace dd if=file1 of=file2 2> out" (7.26 KB, application/x-gzip)
2016-06-23 05:50 EDT, Esa Varemo
no flags Details
dd with bs=131071 (1.18 KB, application/x-gzip)
2016-06-23 11:09 EDT, Esa Varemo
no flags Details
dd with bs=131072 (1.63 KB, application/x-gzip)
2016-06-23 11:10 EDT, Esa Varemo
no flags Details

  None (edit)
Description Sai Ho Lui 2016-02-24 02:37:21 EST
Description of problem:
When trying to copy a file from mounted network filesystem folder into a folder on the local disk the copying process doesn't stop.

Version-Release number of selected component (if applicable):
cp from coreutils-8.24-6.fc23.x86_64

How reproducible:

Steps to Reproduce:
1. mount -t cifs //archive/data /mnt/archive
2. cd /mnt/archive
3. cp krx.dump.bz2 ~ (or any file in this folder)

Actual results:
Having a file in home called krx.dump.bz2 which grows in size without an end.
And cp which doesn't terminate.

Expected results:
A file called krx.dump.bz2 in ~ which is 586K and not >1GB and bigger.

Additional info:
dd if=krx.dump.bz2 of=/home/foo/krx.dump.bz2 is working and is copying the file properly.
Comment 1 Kamil Dudka 2016-05-12 05:21:54 EDT
Sorry for replying late to this bug report!  Is the issue still reproducible?  Could you please attach gzipped output of strace for both cp and dd?
Comment 2 Sai Ho Lui 2016-05-12 05:42:09 EDT
Indeed I cannot reproduce it anymore now, may be due to certain changes in the past few months. Let me close this issue then.
Comment 3 Kamil Dudka 2016-05-12 07:00:05 EDT
It must have been something in the file system implementation.  Glad to see this fixed.  Thanks for the confirmation!
Comment 4 Esa Varemo 2016-06-23 05:48:42 EDT
I am having this same issue copying files from/within an SMB share.
dd works, cp doesn't finish

$ rpm -q coreutils
Comment 5 Esa Varemo 2016-06-23 05:49 EDT
Created attachment 1171395 [details]
Compressed output of "strace cp file1 file2 2> out"
Comment 6 Esa Varemo 2016-06-23 05:50 EDT
Created attachment 1171396 [details]
Compressed output of "strace dd if=file1 of=file2 2> out"
Comment 7 Kamil Dudka 2016-06-23 07:58:58 EDT
Thank you for providing the requested info!

Could you please try to append bs=131072 to dd command line?
Comment 8 Esa Varemo 2016-06-23 11:08:58 EDT
With bs=131072 I get the same results as with cp. bs=131071 and lower is fine.
Comment 9 Esa Varemo 2016-06-23 11:09 EDT
Created attachment 1171569 [details]
dd with bs=131071
Comment 10 Esa Varemo 2016-06-23 11:10 EDT
Created attachment 1171570 [details]
dd with bs=131072
Comment 11 Kamil Dudka 2016-06-23 11:52:33 EDT
Then it looks like a file system bug triggered by reading blocks of size 2^17, which cp seems to do by default.  I am switching the component to kernel, where the file system is implemented...
Comment 12 Laura Abbott 2016-09-23 15:19:54 EDT
*********** MASS BUG UPDATE **************
We apologize for the inconvenience.  There is a large number of bugs to go through and several of them have gone stale.  Due to this, we are doing a mass bug update across all of the Fedora 23 kernel bugs.
Fedora 23 has now been rebased to 4.7.4-100.fc23.  Please test this kernel update (or newer) and let us know if you issue has been resolved or if it is still present with the newer kernel.
If you have moved on to Fedora 24 or 25, and are still experiencing this issue, please change the version to Fedora 24 or 25.
If you experience different issues, please open a new bug report for those.

Note You need to log in before you can comment on or make changes to this bug.