[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20091006153335.15d02d12@gondolin>
Date: Tue, 6 Oct 2009 15:33:35 +0200
From: Cornelia Huck <cornelia.huck@...ibm.com>
To: Greg Kroah-Hartman <gregkh@...e.de>
Cc: Phil Carmody <ext-phil.2.carmody@...ia.com>,
linux-kernel@...r.kernel.org
Subject: [PATCH] sysfs: Allow sysfs_move_dir(..., NULL) again.
As device_move() and kobject_move() both handle a NULL destination,
sysfs_move_dir() should do this as well (again) and fall back to
sysfs_root in that case.
Signed-off-by: Cornelia Huck <cornelia.huck@...ibm.com>
---
fs/sysfs/dir.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
--- linux-2.6.orig/fs/sysfs/dir.c
+++ linux-2.6/fs/sysfs/dir.c
@@ -894,7 +894,8 @@ int sysfs_move_dir(struct kobject *kobj,
mutex_lock(&sysfs_rename_mutex);
BUG_ON(!sd->s_parent);
- new_parent_sd = new_parent_kobj->sd ? new_parent_kobj->sd : &sysfs_root;
+ new_parent_sd = (new_parent_kobj && new_parent_kobj->sd) ?
+ new_parent_kobj->sd : &sysfs_root;
error = 0;
if (sd->s_parent == new_parent_sd)
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists