Bug 764421 (GLUSTER-2689)

Summary: Quota: xattrs getting corrupted
Product: [Community] GlusterFS Reporter: Saurabh <saurabh>
Component: quotaAssignee: Raghavendra G <raghavendra>
Status: CLOSED CURRENTRELEASE QA Contact:
Severity: low Docs Contact:
Priority: low    
Version: mainlineCC: gluster-bugs, raghavendra
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:

Description Saurabh 2011-04-07 12:45:47 UTC
Trying to edit the file over nfs mount corrupts the extended attribute,

1. create a dist vol
2. enable quota, set limit on volume
3. mount it over nfs
4. create a file 
5. edit it, try remove some lines from the file.

Result:-
xattr of the brick in which the file is residing gets corrupted.

logs,
over nfs and when quota is enabled.

[root@centos-qa-client-3 mnt]# getfattr -m . -d -e hex /mnt/dist2/
getfattr: Removing leading '/' from absolute path names
# file: mnt/dist2
trusted.gfid=0x00000000000000000000000000000001
trusted.glusterfs.dht=0x000000010000000000000000ffffffff
trusted.glusterfs.quota.dirty=0x3000
trusted.glusterfs.quota.size=0xfffffffffffff32f

[root@centos-qa-client-3 mnt]# 


#############################

though didn't find it over fuse,

##########################

from client end,

[root@centos-qa-client-1 nfs-test]# touch file
[root@centos-qa-client-1 nfs-test]# vi file
E72: Close error on swap file[root@centos-qa-client-1 nfs-test]# ls -li
total 8
6800889746227272631 -rw-r--r-- 1 root root 93 Apr  7 05:43 file
[root@centos-qa-client-1 nfs-test]# vi file
E72: Close error on swap file[root@centos-qa-client-1 nfs-test]# vi file
[root@centos-qa-client-1 nfs-test]# ls -li
total 8
14644898392211223440 -rw-r--r-- 1 root root 79 Apr  7 05:44 file
[root@centos-qa-client-1 nfs-test]#

Comment 1 Raghavendra G 2011-04-13 08:38:56 UTC
The culprit is in the way vim is creating backup files (files postfixed with ~). It creates a hardlink to existing file and does an unlink on the original name. Now, in marker there would be only one contribution node for both the links (since both links have same parent) and hence during link, file-size corresponding to new-link will not be added to parents. However during unlink, file size is subtracted, there by resulting in negative values.

Comment 2 Anand Avati 2011-04-18 11:42:21 UTC
PATCH: http://patches.gluster.com/patch/6942 in master (features/marker-quota: remove contribution xattrs from oldloc in rename.)

Comment 3 Anand Avati 2011-04-18 11:42:28 UTC
PATCH: http://patches.gluster.com/patch/6943 in master (features/marker-quota: reduce contributions to parents during unlink only if it is the last link.)

Comment 4 Saurabh 2011-04-21 05:28:08 UTC
used vi to edit a file over nfs mount, and the extended attributes were not corrupted.