Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id ; Tue, 15 Oct 2002 16:22:49 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id ; Tue, 15 Oct 2002 16:22:45 -0400 Received: from smtp3.us.dell.com ([143.166.148.134]:49423 "EHLO smtp3.us.dell.com") by vger.kernel.org with ESMTP id ; Tue, 15 Oct 2002 16:22:06 -0400 Date: Tue, 15 Oct 2002 15:27:59 -0500 (CDT) From: Matt Domsch X-X-Sender: mdomsch@humbolt.us.dell.com Reply-To: Matt Domsch To: mochel@osdl.org cc: linux-kernel@vger.kernel.org Subject: driverfs dir removal bug in 2.5.41 Message-ID: X-GPG-Fingerprint: 17A4 17D0 81F5 4B5F DB1C AEF8 21AB EEF7 92F0 FC09 X-GPG-Key: http://domsch.com/mdomsch_pub.asc MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2070 Lines: 73 Pat, I've run across a weird error with driverfs. When removing a directory that has had a symlink created in it, directory removal fails. Since there's no return code from the function, there's no way to know that it failed, but it shouldn't fail regardless. The driverfs_remove_dir(&dir) fails. The files and symlinks in the directory are removed, but the directory itself isn't removed. Below is a small test module (tried in 2.5.41) that shows the behavior. In test_exit(), driverfs_remove_file() shouldn't be necessary, and in fact doesn't matter if it's there or not - same failure is seen either way. The name of the symlink doesn't matter either. I haven't torn into driverfs (nor played with ramfs) to see where the failure is occurring, hoped you'd know off the top of your head. Thanks, Matt -- Matt Domsch Sr. Software Engineer, Lead Engineer, Architect Dell Linux Solutions www.dell.com/linux Linux on Dell mailing lists @ http://lists.us.dell.com /* * driverfs_symlink_test.c */ #include #include #include #include #include #include #include MODULE_AUTHOR("Matt Domsch "); MODULE_DESCRIPTION("driverfs symlink test"); MODULE_LICENSE("GPL"); static struct driver_dir_entry test_dir = { .name = "test", .mode = (S_IFDIR | S_IRWXU | S_IRUGO | S_IXUGO), }; static int __init test_init(void) { int rc; printk(KERN_INFO "driverfs symlink test\n"); rc = driverfs_create_dir(&test_dir, NULL); if (rc) return rc; rc = driverfs_create_symlink(&test_dir, "test", "../"); return rc; } static void __exit test_exit(void) { driverfs_remove_file(&test_dir, "test"); driverfs_remove_dir(&test_dir); } late_initcall(test_init); module_exit(test_exit); - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/