Bug 1056085

Summary: logs flooded with invalid argument errors with quota enabled
Product: [Community] GlusterFS Reporter: Kaleb KEITHLEY <kkeithle>
Component: quotaAssignee: Vijaikumar Mallikarjuna <vmallika>
Status: CLOSED CURRENTRELEASE QA Contact:
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 3.4.2CC: bugs, gluster-bugs, smohan, vmallika
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2015-04-13 06:44:19 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:
Bug Depends On: 1184885, 1203648, 1222847    
Bug Blocks:    
Attachments:
Description Flags
volx log globbed copy
none
volx log noglob copies none

Description Kaleb KEITHLEY 2014-01-21 14:16:06 UTC
Created attachment 853252 [details]
volx log globbed copy

Description of problem:

When quota is enabled globbed file actions, e.g. cp foo* destdir, the logs are flooded with error messages:
  ... (-->/usr/lib64/glusterfs/3.4git/xlator/features/marker.so(mq_dict_set_contribution+0x156) [0x7ffddccf8b76]) 0-marker: invalid argument: loc->parent

Version-Release number of selected component (if applicable):

3.4.2 and earlier


How reproducible:

Create a volume, enable quota, set limit-usage. mount the volume at, e.g. /mnt. Copy a few files to /mnt, make a few subdirs on /mnt, then `cd /mnt; cp $single-file-name $subdirX`. Note that there are no errors in the volume log file.

Now do `cp $wildcard* $subdirY` and notice the error entries in the log file.

Steps to Reproduce:
1.
2.
3.

Actual results:


Expected results:


Additional info:

See the attached log files. (N.B. they have lots of extra logging that's not in the git source.)  The files here are have names dummy[123456789] and subdirs are dir[123456789]. There's a race condition in the resolve code. At line 261 of the var-tmp-volx.log.glob you can see that when trying to resolve inode d6273087-0639-46df-9f3d-5a9070977c0f it's not found in the inode table, and then is inserted at line 264 in the call to inode_link().

Looking at var-tmp-volx.log.noglob it's apparent that the inode is inserted into the inode table earlier (earlier than the glob case), and the respective lookup succeeds.

It appears that in the glob case, the reason the inode isn't inserted in the inode table sooner is because these lines are commented out in the readdir and readdirp fops in server-rpc-fops.c, in server_readdirp_cbk() and server_readdir_cbk():
  
        /* TODO: need more clear thoughts before calling this function. */
        /* gf_link_inodes_from_dirent (this, state->fd->inode, entries); */

Which is not to say that these lines should be blindly uncommented. Maybe instead we need to simply not log an error when loc->parent == NULL in mq_dict_set_contribution()?

Comment 1 Kaleb KEITHLEY 2014-01-21 14:21:42 UTC
Created attachment 853254 [details]
volx log noglob copies

Comment 2 Vijaikumar Mallikarjuna 2015-03-19 06:15:52 UTC
Patch http://review.gluster.org/#/c/9478/ merged