Bug 989702

Summary: A non-empty file created on glusterfs with ecryptfs reports as a file of size zero
Product: [Community] GlusterFS Reporter: Takashi Osako <tosako>
Component: coreAssignee: Amar Tumballi <amarts>
Status: CLOSED WONTFIX QA Contact:
Severity: medium Docs Contact:
Priority: unspecified    
Version: 3.3.1CC: gluster-bugs, vraman
Target Milestone: ---   
Target Release: ---   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2013-07-29 19:21:56 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:
Embargoed:

Description Takashi Osako 2013-07-29 18:21:41 UTC
ecryptfs was mounted on glusterfs.  When I created a non-empty file, OS reported 0 byte file.

Version-Release number of selected component (if applicable):
glusterfs-fuse-3.3.1-1.el6.x86_64
glusterfs-3.3.1-1.el6.x86_64
ecryptfs-utils-82-6.el6_1.3.x86_64

How reproducible:
This bug is reproducible all the time.

Steps to Reproduce:
1. mount -t ecryptfs /mnt/gluster/foo /mnt/gluster/foo
Select key type to use for newly created files: 
 1) passphrase
 2) openssl
 3) tspi
Selection: 1
Passphrase: hello1
Select cipher: 
 1) aes: blocksize = 16; min keysize = 16; max keysize = 32 (not loaded)
 2) blowfish: blocksize = 16; min keysize = 16; max keysize = 56 (not loaded)
 3) des3_ede: blocksize = 8; min keysize = 24; max keysize = 24 (not loaded)
 4) cast6: blocksize = 16; min keysize = 16; max keysize = 32 (not loaded)
 5) cast5: blocksize = 8; min keysize = 5; max keysize = 16 (not loaded)
Selection [aes]: 
Select key bytes: 
 1) 16
 2) 32
 3) 24
Selection [16]: 
Enable plaintext passthrough (y/n) [n]: 
Enable filename encryption (y/n) [n]: y
Filename Encryption Key (FNEK) Signature [febe72cdfa2db7e0]: 
Attempting to mount with the following options:
  ecryptfs_unlink_sigs
  ecryptfs_fnek_sig=febe72cdfa2db7e0
  ecryptfs_key_bytes=16
  ecryptfs_cipher=aes
  ecryptfs_sig=febe72cdfa2db7e0
Mounted eCryptfs
2. df -h
Filesystem            Size  Used Avail Use% Mounted on
/mnt/gluster/foo
                      591G  207M  561G   1% /mnt/gluster/foo
3. echo "hello world" > /mnt/gluster/foo/test.txt
4. ls -l  /mnt/gluster/foo/test.txt
-rw-r--r-- 1 root root 0 Jul 29 14:08 /mnt/gluster/pdf-ecryptfs/test.txt

Actual results:
0 byte

Expected results:
12 bytes

Comment 1 Takashi Osako 2013-07-29 19:21:56 UTC
FUSE O_DIRECT issue.