Bug 788150

Summary: Improper Error Code is returned when 'mkdir .glusterfs' is issued on mountpoint.
Product: [Community] GlusterFS Reporter: M S Vishwanath Bhat <vbhat>
Component: coreAssignee: Kaushal <kaushal>
Status: CLOSED UPSTREAM QA Contact:
Severity: high Docs Contact:
Priority: high    
Version: mainlineCC: amarts, gluster-bugs, mzywusko, vbellur
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: 2012-05-09 12:23:45 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 M S Vishwanath Bhat 2012-02-07 15:33:24 UTC
Description of problem:
If user tries to create directory named .glusterfs, currently ENODATA (No data available) is returned which is not so correct when we can return more meaning full Error Codes, like EPERM (Operation Not Permitted) or EACCES (Permission Denied) or else EEXIST (file exists)

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

How reproducible:
always

Steps to Reproduce:
1. Run mkdir .glusterfs on mountpoint.
  
Actual results:
[root@RHEL6 mnt]# mkdir .glusterfs
mkdir: cannot create directory `.glusterfs': No data available


Expected results:
Error code should be more meaningful, like EPERM or EACCES or EEXIST

Comment 1 Amar Tumballi 2012-02-08 12:32:19 UTC
Is a known issue for now, we need to document it, after fixing the exact error code.

Comment 2 Amar Tumballi 2012-02-20 06:45:39 UTC
Avati, what do you think should be the standard error for this ? Helps for documentation if we have single error for this case.

Comment 3 Vijay Bellur 2012-04-19 12:52:16 UTC
Kaushal.

Can you please send out op_errno=EEXIST upon encountering this mkdir?

Comment 4 Kaushal 2012-04-20 05:25:20 UTC
In master, right now we get EPERM as errno on the lookup perfomed before mkdir.
This is set by posix_lookup().
Is this enough or is it needed to have a safegaurd in posix_mkdir() as well?

Comment 5 Amar Tumballi 2012-04-20 05:35:45 UTC
Can you just make sure to return the same errno in posix_mkdir() too? That would make it clean. Vijay/Avati, any thoughts?

Comment 6 Anand Avati 2012-04-20 13:06:38 UTC
CHANGE: http://review.gluster.com/3200 (storage/posix: Don't allow mkdir() on HIDDEN_DIRECTORY) merged in master by Vijay Bellur (vijay)

Comment 7 M S Vishwanath Bhat 2012-05-09 12:10:54 UTC
With glusterfs-3.3.0qa40 I get EPERM (Operation not permitted). Is this the errno to be returned or EEXIST?

Comment 8 Amar Tumballi 2012-05-09 12:13:55 UTC
We want to tell user that you don't have Permission to create (ie, EPERM), hence its fine.

Comment 9 M S Vishwanath Bhat 2012-05-09 12:23:45 UTC
Then moving it to closed upstream.