Bug 1311395

Summary: CIFS reads beyond end of file if 131072 is used as block size
Product: [Fedora] Fedora Reporter: Sai Ho Lui <shlui>
Component: kernelAssignee: Kernel Maintainer List <kernel-maint>
Status: CLOSED EOL QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: high Docs Contact:
Priority: unspecified    
Version: 23CC: admiller, esa, gansalmon, itamar, jonathan, kdudka, kernel-maint, kzak, madhu.chinakonda, mchehab, ooprala, ovasik, p, shlui, twaugh
Target Milestone: ---Keywords: Reopened
Target Release: ---   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2016-10-11 00:42:35 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Attachments:
Description Flags
Compressed output of "strace cp file1 file2 2> out"
none
Compressed output of "strace dd if=file1 of=file2 2> out"
none
dd with bs=131071
none
dd with bs=131072 none

Description Sai Ho Lui 2016-02-24 07:37:21 UTC
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:
Always

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 09:21:54 UTC
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 09:42:09 UTC
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 11:00:05 UTC
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 09:48:42 UTC
I am having this same issue copying files from/within an SMB share.
dd works, cp doesn't finish

$ rpm -q coreutils
coreutils-8.24-7.fc23.x86_64

Comment 5 Esa Varemo 2016-06-23 09:49:46 UTC
Created attachment 1171395 [details]
Compressed output of "strace cp file1 file2 2> out"

Comment 6 Esa Varemo 2016-06-23 09:50:12 UTC
Created attachment 1171396 [details]
Compressed output of "strace dd if=file1 of=file2 2> out"

Comment 7 Kamil Dudka 2016-06-23 11:58:58 UTC
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 15:08:58 UTC
With bs=131072 I get the same results as with cp. bs=131071 and lower is fine.

Comment 9 Esa Varemo 2016-06-23 15:09:58 UTC
Created attachment 1171569 [details]
dd with bs=131071

Comment 10 Esa Varemo 2016-06-23 15:10:54 UTC
Created attachment 1171570 [details]
dd with bs=131072

Comment 11 Kamil Dudka 2016-06-23 15:52:33 UTC
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 19:19:54 UTC
*********** 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.