Bug 761958 (GLUSTER-226) - mkdir after rm of regular file of same name fails
Summary: mkdir after rm of regular file of same name fails
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: GLUSTER-226
Product: GlusterFS
Classification: Community
Component: core
Version: mainline
Hardware: All
OS: Linux
low
medium
Target Milestone: ---
Assignee: Anand Avati
QA Contact:
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2009-08-24 14:05 UTC by Pavan Vilas Sondur
Modified: 2015-09-01 23:04 UTC (History)
4 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed:
Regression: RTA
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:


Attachments (Terms of Use)

Description Pavan Vilas Sondur 2009-08-24 11:52:24 UTC
My mistake - This is a posix entrylk problem, while testing the new code changes - removing READLK and wasn't very apparent. Marking it invalid.

Comment 1 Pavan Vilas Sondur 2009-08-24 14:05:55 UTC
If a regular file 'x' exists and it is removed and a directory of the same name 'x' is tried to create, it fails, saying File exists. The back-end however does not have the file. I encountered this in a simple AFR config.

pavan@dapawz:~/mounts/mnt1/locks$ touch test
pavan@dapawz:~/mounts/mnt1/locks$ ls
a  b  file  locktests  locktests.c  locktests.c~  Makefile  test
pavan@dapawz:~/mounts/mnt1/locks$ rm test
pavan@dapawz:~/mounts/mnt1/locks$ ls
a  b  file  locktests  locktests.c  locktests.c~  Makefile
pavan@dapawz:~/mounts/mnt1/locks$ mkdir test
mkdir: cannot create directory `test': File exists

I've moved the log files and spec files to /share/tickets/<bug id> since the file sizes were huge.

Comment 2 Pavan Vilas Sondur 2009-08-25 06:16:48 UTC
Infact - the bug does exist. Every mkdir fails and it says that the file exists. If a long name is given for the directory name, it succeeds, but the directory created has a truncated name. I noticed this on a simple AFR config. However, the backend directories are consistent, and have the same exact truncated directory if the mkdir succeeds.

Comment 3 Pavan Vilas Sondur 2009-08-25 06:18:39 UTC
[root@management mnt1]# mkdir ggggggg
mkdir: cannot create directory `ggggggg': File exists
[root@management mnt1]# mkdir ggggggggggg
[root@management mnt1]# ls
abc  ggg

[root@management mnt1]# mkdir a
mkdir: cannot create directory `a': File exists
[root@management mnt1]# mkdir b
mkdir: cannot create directory `b': File exists
[root@management mnt1]# ls
abc  ggg

Comment 4 Pavan Vilas Sondur 2009-08-25 06:29:39 UTC
Volfiles and log files in /share/tickets/226/

..<snip>
009-08-25 14:48:14] E [posix.c:814:posix_mkdir] posix: mkdir of / failed: File exists
[2009-08-25 14:48:14] T [server-protocol.c:772:server_mkdir_cbk] server: 172: MKDIR /  ==> -1 (File exists)
[2009-08-25 14:48:14] T [server-protocol.c:4565:server_xattrop_resume] brick: 55: XATTROP '/ (1)'

Comment 5 Vikas Gorur 2009-08-25 06:38:58 UTC
Verified that mkdir always fails even in a simple FUSE->posix setup.

$ mkdir blah
mkdir: cannot create directory 'blah': File exists

$ mkdir 1234567890
$ ls

90

The first eight characters appear to get truncated, and thus for short names an mkdir is attempted on "/", which fails with EEXIST.

Comment 6 Anand Avati 2009-09-01 20:28:41 UTC
PATCH: http://patches.gluster.com/patch/1161 in master (fuse: protocol fix: fix bogus parsing of MKDIR message)


Note You need to log in before you can comment on or make changes to this bug.