From owner-freebsd-bugs@FreeBSD.ORG Fri Nov 6 16:10:06 2009 Return-Path: Delivered-To: freebsd-bugs@hub.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2D8B9106568F for ; Fri, 6 Nov 2009 16:10:06 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by mx1.freebsd.org (Postfix) with ESMTP id 024868FC14 for ; Fri, 6 Nov 2009 16:10:06 +0000 (UTC) Received: from freefall.freebsd.org (localhost [127.0.0.1]) by freefall.freebsd.org (8.14.3/8.14.3) with ESMTP id nA6GA5hg001642 for ; Fri, 6 Nov 2009 16:10:05 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.14.3/8.14.3/Submit) id nA6GA5FL001641; Fri, 6 Nov 2009 16:10:05 GMT (envelope-from gnats) Date: Fri, 6 Nov 2009 16:10:05 GMT Message-Id: <200911061610.nA6GA5FL001641@freefall.freebsd.org> To: freebsd-bugs@FreeBSD.org From: Alexander Best Cc: Subject: Re: kern/59739: [libc] rmdir(2) and mkdir(2) both return EISDIR for argument "/" X-BeenThere: freebsd-bugs@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: Alexander Best List-Id: Bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 06 Nov 2009 16:10:06 -0000 The following reply was made to PR kern/59739; it has been noted by GNATS. From: Alexander Best To: , 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 #include #include #include 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+--