Re: kern/59739: [libc] rmdir(2) and mkdir(2) both return EISDIR for argument "/"

View: New views
4 Messages — Rating Filter:   Alert me  

Re: kern/59739: [libc] rmdir(2) and mkdir(2) both return EISDIR for argument "/"

by Alexander Best :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

The following reply was made to PR kern/59739; it has been noted by GNATS.

From: Alexander Best <alexbestms@...>
To: <bug-followup@...>,
 <asf@...>
Cc:  
Subject: Re: kern/59739: [libc] rmdir(2) and mkdir(2) both return EISDIR for
 argument "/"
Date: Fri, 06 Nov 2009 17:08:08 +0100 (CET)

   This is a MIME encoded multipart message.
 
 --+permail-2009110616080880e26a0b000067d5-a_best01+
 Content-Type: text/plain; charset=us-ascii
 Content-Transfer-Encoding: 7bit
 
 this problem still exists under 9-current.
 
 the following test app:
 
 #include <sys/stat.h>
 #include <errno.h>
 #include <stdio.h>
 #include <unistd.h>
 
 main() {
     rmdir("/");
     printf("rmdir errno: %d\n", errno);
     mkdir("/", 511);
     printf("mkdir errno: %d\n", errno);
 }
 
 produces this output:
 
 rmdir errno: 21
 mkdir errno: 21
 
 which is EISDIR (as reported by Andreas Fuchs).
 
 could somebody please check if the attached patch is sufficient to solve this
 problem? with the patch the test app now outputs:
 
 rmdir errno: 16
 mkdir errno: 17
 
 16 being EBUSY and 17 being EEXIST. this is what Andreas Fuchs suggested.
 
 cheers.
 alex
 
 --+permail-2009110616080880e26a0b000067d5-a_best01+
 Content-Type: text/plain
 Content-Transfer-Encoding: Base64
 Content-Disposition: attachment; filename="vfslookup.c.patch.txt"
 
 LS0tIHZmc19sb29rdXAuYwkyMDA5LTExLTA2IDE2OjE0OjQxLjAwMDAwMDAwMCArMDEwMAorKysg
 L3Vzci9zcmMvc3lzL2tlcm4vdmZzX2xvb2t1cC5jCTIwMDktMTEtMDYgMTY6MTM6MTkuMDAwMDAw
 MDAwICswMTAwCkBAIC0zNSw3ICszNSw3IEBACiAgKi8KIAogI2luY2x1ZGUgPHN5cy9jZGVmcy5o
 PgotX19GQlNESUQoIiRGcmVlQlNEJCIpOworX19GQlNESUQoIiRGcmVlQlNEOiBoZWFkL3N5cy9r
 ZXJuL3Zmc19sb29rdXAuYyAxOTU5MzkgMjAwOS0wNy0yOSAwNzo0NDo0M1ogcndhdHNvbiAkIik7
 CiAKICNpbmNsdWRlICJvcHRfa2R0cmFjZS5oIgogI2luY2x1ZGUgIm9wdF9rdHJhY2UuaCIKQEAg
 LTU2Myw4ICs1NjMsMTIgQEAKIAkJCWVycm9yID0gRU5PVERJUjsKIAkJCWdvdG8gYmFkOwogCQl9
 Ci0JCWlmIChjbnAtPmNuX25hbWVpb3AgIT0gTE9PS1VQKSB7Ci0JCQllcnJvciA9IEVJU0RJUjsK
 KwkJaWYgKGNucC0+Y25fbmFtZWlvcCAhPSBMT09LVVAgJiYgY25wLT5jbl9uYW1laW9wID09IERF
 TEVURSkgeworCQkJZXJyb3IgPSBFQlVTWTsKKwkJCWdvdG8gYmFkOworCQl9CisJCWlmIChjbnAt
 PmNuX25hbWVpb3AgIT0gTE9PS1VQICYmIGNucC0+Y25fbmFtZWlvcCA9PSBDUkVBVEUpIHsKKwkJ
 CWVycm9yID0gRUVYSVNUOwogCQkJZ290byBiYWQ7CiAJCX0KIAkJaWYgKHdhbnRwYXJlbnQpIHsK
 
 --+permail-2009110616080880e26a0b000067d5-a_best01+--
_______________________________________________
freebsd-bugs@... mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-bugs
To unsubscribe, send any mail to "freebsd-bugs-unsubscribe@..."

Parent Message unknown Re: kern/59739: [libc] rmdir(2) and mkdir(2) both return EISDIR for argument "/"

by Alexander Best :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

The following reply was made to PR kern/59739; it has been noted by GNATS.

From: Alexander Best <alexbestms@...>
To: <bug-followup@...>,
 <asf@...>
Cc:  
Subject: Re: kern/59739: [libc] rmdir(2) and mkdir(2) both return EISDIR for
 argument "/"
Date: Fri, 06 Nov 2009 17:49:41 +0100 (CET)

 the patch supplied in the previous followup is currently being discussed in
 this thread:
 
 http://lists.freebsd.org/pipermail/freebsd-hackers/2009-November/029928.html
 
 a final patch will be supplied in the next few days as followup to this
 problem report. thus please ignore the previous patch.
 
 alex
_______________________________________________
freebsd-bugs@... mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-bugs
To unsubscribe, send any mail to "freebsd-bugs-unsubscribe@..."

Parent Message unknown Re: kern/59739: [libc] rmdir(2) and mkdir(2) both return EISDIR for argument "/"

by linimon :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Synopsis: [libc] rmdir(2) and mkdir(2) both return EISDIR for argument "/"

State-Changed-From-To: suspended->open
State-Changed-By: linimon
State-Changed-When: Fri Nov 6 18:14:42 UTC 2009
State-Changed-Why:
There is now an open thread dicussing the patch (see Audit-Trail).

http://www.freebsd.org/cgi/query-pr.cgi?pr=59739
_______________________________________________
freebsd-bugs@... mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-bugs
To unsubscribe, send any mail to "freebsd-bugs-unsubscribe@..."

Parent Message unknown Re: kern/59739: [libc] rmdir(2) and mkdir(2) both return EISDIR for argument "/"

by Alexander Best :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

The following reply was made to PR kern/59739; it has been noted by GNATS.

From: Alexander Best <alexbestms@...>
To: <bug-followup@...>,
 <asf@...>
Cc:  
Subject: Re: kern/59739: [libc] rmdir(2) and mkdir(2) both return EISDIR for
 argument "/"
Date: Sun, 08 Nov 2009 04:05:11 +0100 (CET)

   This is a MIME encoded multipart message.
 
 --+permail-200911080305111e86ffa800003557-a_best01+
 Content-Type: text/plain; charset=us-ascii
 Content-Transfer-Encoding: 7bit
 
 after discussing this problem in the thread mentioned in the previous followup
 it was decide to move all changes to sys/kern/vfs_syscalls.c in order not to
 break any code which relies on namei() returning EISDIR.
 
 attached you'll find the final patch (which supersedes the previous one). this
 patch doesn't require any changes to the rename(2), mkdir(2) or rmdir(2)
 manuals.
 
 please set this pr into analysed state.
 
 alex
 
 --+permail-200911080305111e86ffa800003557-a_best01+
 Content-Type: text/plain
 Content-Transfer-Encoding: Base64
 Content-Disposition: attachment; filename="vfssyscalls.c.patch.txt"
 
 SW5kZXg6IHN5cy9rZXJuL3Zmc19zeXNjYWxscy5jCj09PT09PT09PT09PT09PT09PT09PT09PT09
 PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KLS0tIHN5cy9rZXJuL3Zm
 c19zeXNjYWxscy5jCShyZXZpc2lvbiAxOTkwMTYpCisrKyBzeXMva2Vybi92ZnNfc3lzY2FsbHMu
 Ywkod29ya2luZyBjb3B5KQpAQCAtMzU4Nyw4ICszNTg3LDEyIEBACiAJICAgIEFVRElUVk5PREUx
 LCBwYXRoc2VnLCBvbGQsIG9sZGZkLCB0ZCk7CiAjZW5kaWYKIAotCWlmICgoZXJyb3IgPSBuYW1l
 aSgmZnJvbW5kKSkgIT0gMCkKKwlpZiAoKGVycm9yID0gbmFtZWkoJmZyb21uZCkpICE9IDApIHsK
 KwkJLyogVHJhbnNsYXRlIGVycm9yIGNvZGUgZm9yIHJlbmFtZSgiLyIsICJkaXIyIikuICovCisJ
 CWlmIChlcnJvciA9PSBFSVNESVIpCisJCQllcnJvciA9IEVJTlZBTDsKIAkJcmV0dXJuIChlcnJv
 cik7CisJfQogCWZ2ZnNsb2NrZWQgPSBOREhBU0dJQU5UKCZmcm9tbmQpOwogCXR2ZnNsb2NrZWQg
 PSAwOwogI2lmZGVmIE1BQwpAQCAtMzczNyw4ICszNzQxLDEyIEBACiAJTkRJTklUX0FUKCZuZCwg
 Q1JFQVRFLCBMT0NLUEFSRU5UIHwgU0FWRU5BTUUgfCBNUFNBRkUgfCBBVURJVFZOT0RFMSwKIAkg
 ICAgc2VnZmxnLCBwYXRoLCBmZCwgdGQpOwogCW5kLm5pX2NuZC5jbl9mbGFncyB8PSBXSUxMQkVE
 SVI7Ci0JaWYgKChlcnJvciA9IG5hbWVpKCZuZCkpICE9IDApCisJaWYgKChlcnJvciA9IG5h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2Fu
 bm90IGJlIGRlbGV0ZWQuCiAJICovCiAJaWYgKHZwLT52X3ZmbGFnICYgVlZfUk9PVCkgewo=
 
 --+permail-200911080305111e86ffa800003557-a_best01+--
_______________________________________________
freebsd-bugs@... mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-bugs
To unsubscribe, send any mail to "freebsd-bugs-unsubscribe@..."