From patchwork Wed Jul 21 05:12:01 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Eric W. Biederman" X-Patchwork-Id: 59402 X-Patchwork-Delegate: davem@davemloft.net Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id C1D01B70AA for ; Wed, 21 Jul 2010 15:12:39 +1000 (EST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755265Ab0GUFMI (ORCPT ); Wed, 21 Jul 2010 01:12:08 -0400 Received: from out01.mta.xmission.com ([166.70.13.231]:33497 "EHLO out01.mta.xmission.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1762114Ab0GUFMF (ORCPT ); Wed, 21 Jul 2010 01:12:05 -0400 Received: from in02.mta.xmission.com ([166.70.13.52]) by out01.mta.xmission.com with esmtps (TLSv1:AES256-SHA:256) (Exim 4.69) (envelope-from ) id 1ObRbA-0007eN-OQ; Tue, 20 Jul 2010 23:12:04 -0600 Received: from c-67-188-4-80.hsd1.ca.comcast.net ([67.188.4.80] helo=fess.ebiederm.org) by in02.mta.xmission.com with esmtpsa (TLSv1:AES256-SHA:256) (Exim 4.69) (envelope-from ) id 1ObRbA-00088q-FV; Tue, 20 Jul 2010 23:12:04 -0600 Received: from fess.ebiederm.org (localhost [127.0.0.1]) by fess.ebiederm.org (8.14.3/8.14.3/Debian-4) with ESMTP id o6L5C1wr009495; Tue, 20 Jul 2010 22:12:01 -0700 Received: (from eric@localhost) by fess.ebiederm.org (8.14.3/8.14.3/Submit) id o6L5C1vT009494; Tue, 20 Jul 2010 22:12:01 -0700 To: Greg KH Cc: Andrew Morton , Greg KH , "Rafael J. Wysocki" , "Maciej W. Rozycki" , Kay Sievers , Johannes Berg , netdev Subject: [PATCH 2/2] sysfs: allow creating symlinks from untagged to tagged directories References: <20100621222938.GA20583@suse.de> <20100621231058.GA1066@suse.de> <20100622035631.GA3755@suse.de> <20100708211930.GA15385@kroah.com> <20100708230601.GB17002@kroah.com> <20100719133451.0862ca62.akpm@linux-foundation.org> <20100720201334.GA11991@suse.de> From: ebiederm@xmission.com (Eric W. Biederman) Date: Tue, 20 Jul 2010 22:12:01 -0700 In-Reply-To: (Eric W. Biederman's message of "Tue\, 20 Jul 2010 22\:10\:58 -0700") Message-ID: User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/22.2 (gnu/linux) MIME-Version: 1.0 X-XM-SPF: eid=; ; ; mid=; ; ; hst=in02.mta.xmission.com; ; ; ip=67.188.4.80; ; ; frm=ebiederm@xmission.com; ; ; spf=neutral X-SA-Exim-Connect-IP: 67.188.4.80 X-SA-Exim-Mail-From: ebiederm@xmission.com X-SA-Exim-Scanned: No (on in02.mta.xmission.com); SAEximRunCond expanded to false Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org Supporting symlinks from untagged to tagged directories is reasonable, and needed to support CONFIG_SYSFS_DEPRECATED. So don't fail a prior allowing that case to work. Signed-off-by: Eric W. Biederman --- fs/sysfs/symlink.c | 3 ++- 1 files changed, 2 insertions(+), 1 deletions(-) diff --git a/fs/sysfs/symlink.c b/fs/sysfs/symlink.c index 6603833..a7ac78f 100644 --- a/fs/sysfs/symlink.c +++ b/fs/sysfs/symlink.c @@ -67,7 +67,8 @@ static int sysfs_do_create_link(struct kobject *kobj, struct kobject *target, sysfs_addrm_start(&acxt, parent_sd); /* Symlinks must be between directories with the same ns_type */ - if (ns_type == sysfs_ns_type(sd->s_symlink.target_sd->s_parent)) { + if (!ns_type || + (ns_type == sysfs_ns_type(sd->s_symlink.target_sd->s_parent))) { if (warn) error = sysfs_add_one(&acxt, sd); else