Bug 669511

Summary: [btrfs] Transmission torrent files padded with null
Product: [Fedora] Fedora Reporter: Sitsofe Wheeler <sitsofe>
Component: kernelAssignee: Josef Bacik <jbacik>
Status: CLOSED ERRATA QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: medium Docs Contact:
Priority: low    
Version: 14CC: gansalmon, itamar, jonathan, kernel-maint, madhu.chinakonda
Target Milestone: ---   
Target Release: ---   
Hardware: x86_64   
OS: Unspecified   
Whiteboard:
Fixed In Version: kernel-2.6.35.11-83.fc14 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2011-02-11 02:47:11 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:

Description Sitsofe Wheeler 2011-01-13 20:51:16 UTC
Description of problem:
When downloading a bittorrent file to a btrfs filesystem the file contents is sometimes padded by nulls. 

Version-Release number of selected component (if applicable):
Fedora 14
kernel-2.6.35.10-74.fc14.x86_64
transmission-common-2.11-2.fc14.x86_64
transmission-gtk-2.11-2.fc14.x86_64

How reproducible:
Reproducible every time.

Steps to Reproduce:
1. Type
dd if=/dev/zero of=/dev/shm/btrfs.fs count=400 bs=1M
mkfs.btrfs /dev/shm/btrfs.fs
mkdir /dev/shm/btrfs
/bin/su -c "mount -o loop /dev/shm/btrfs.fs /dev/shm/btrfs; chown 777 /dev/shm/btrfs/"

(this should make a btrfs filesystem if you have btrfs-progs)
2. Run
transmission-gtk http://download2.bittornado.com/download/BitTornado-0.3.18-w32install.exe.torrent
(or whatever the "download via BitTorrent" link on http://www.bittornado.com/download.html is)
3. In the "Torrent Options" window set the Destination Folder to /dev/shm/btrfs/ .
4. Wait for the file to fully download.
5. Run
md5sum /dev/shm/btrfs/BitTornado-0.3.18-w32install.exe

(or whatever the downloaded file was called)
  
Actual results:
161c85a87dc0d973526a4a066abb4f83  /dev/shm/btrfs/BitTornado-0.3.18-w32install.exe

tail -c 1800 /dev/shm/btrfs/BitTornado-0.3.18-w32install.exe | hexdump
0000000 cef4 9d15 e5eb aee4 1691 97fc bd80 b7ed
0000010 9df7 fab2 427f 6896 6d37 a3ed eeff 6851
0000020 dcb8 a5f0 00bc 0000 0000 0000 0000 0000
0000030 0000 0000 0000 0000 0000 0000 0000 0000
*
0000700 0000 0000 0000 0000                    
0000708

Expected results:
0783ba53b308f400883a94d2da4cecb4  /dev/shm/btrfs/BitTornado-0.3.18-w32install.exe
(or whatever the hash on http://www.bittornado.com/download.html says)

tail -c 37 /dev/shm/btrfs/BitTornado-0.3.18-w32install.exe | hexdump 
0000000 cef4 9d15 e5eb aee4 1691 97fc bd80 b7ed
0000010 9df7 fab2 427f 6896 6d37 a3ed eeff 6851
0000020 dcb8 a5f0 00bc                         
0000025

Additional info:
Using an ext4 or tmpfs filesystem does not show the problem.

Comment 2 Chuck Ebbert 2011-01-16 17:36:49 UTC
Fix will be in 2.6.35.10-78.fc14

Comment 3 Fedora Update System 2011-02-07 13:35:59 UTC
kernel-2.6.35.11-83.fc14 has been submitted as an update for Fedora 14.
https://admin.fedoraproject.org/updates/kernel-2.6.35.11-83.fc14

Comment 4 Fedora Update System 2011-02-10 21:26:37 UTC
kernel-2.6.35.11-83.fc14 has been pushed to the Fedora 14 stable repository.  If problems still persist, please make note of it in this bug report.