Message ID | 149380754432.3812.6056635780417402774.stgit@localhost.localdomain (mailing list archive) |
---|---|
State | New, archived |
Headers | show
Return-Path: <linux-fsdevel-owner@kernel.org> Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 07F3160385 for <patchwork-linux-fsdevel@patchwork.kernel.org>; Wed, 3 May 2017 10:33:11 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id E95BD284E5 for <patchwork-linux-fsdevel@patchwork.kernel.org>; Wed, 3 May 2017 10:33:10 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id DDE60285EB; Wed, 3 May 2017 10:33:10 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, RCVD_IN_DNSWL_HI autolearn=unavailable version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id C799E284E5 for <patchwork-linux-fsdevel@patchwork.kernel.org>; Wed, 3 May 2017 10:33:09 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753434AbdECKcj (ORCPT <rfc822;patchwork-linux-fsdevel@patchwork.kernel.org>); Wed, 3 May 2017 06:32:39 -0400 Received: from mail-db5eur01on0109.outbound.protection.outlook.com ([104.47.2.109]:33504 "EHLO EUR01-DB5-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1753365AbdECKcf (ORCPT <rfc822;linux-fsdevel@vger.kernel.org>); Wed, 3 May 2017 06:32:35 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=virtuozzo.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=V3zbEZCmxzYTuzh58Hk7hoS/NC458hD+AUf0SlnPE/g=; b=PsoyESQI8OpLy0hodtPKGtOusAZVtwk6GlX0cMQG+dIysXI5gPwS+eQWD4FmljZpiw4jA8QxJqib4neOVqgDNXNqAWQDtR0ejIWg8bfizLQU1KcP8U8qfqwC9MmwqEAQ4Qc/8fzgjj9VUFgj0lFyshrCeZlt97NJbGhEWmecZQI= Authentication-Results: hallyn.com; dkim=none (message not signed) header.d=none; hallyn.com; dmarc=none action=none header.from=virtuozzo.com; Received: from localhost.localdomain (195.214.232.6) by AM4PR0802MB2274.eurprd08.prod.outlook.com (10.172.218.7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1061.12; Wed, 3 May 2017 10:32:26 +0000 Subject: [PATCH v3 1/2] ns: Allow ns_entries to have custom symlink content From: Kirill Tkhai <ktkhai@virtuozzo.com> To: <agruenba@redhat.com>, <keescook@chromium.org>, <linux-api@vger.kernel.org>, <oleg@redhat.com>, <viro@zeniv.linux.org.uk>, <linux-kernel@vger.kernel.org>, <paul@paul-moore.com>, <ktkhai@virtuozzo.com>, <ebiederm@xmission.com>, <avagin@openvz.org>, <linux-fsdevel@vger.kernel.org>, <mtk.manpages@gmail.com>, <akpm@linux-foundation.org>, <luto@amacapital.net>, <gorcunov@openvz.org>, <mingo@kernel.org>, <serge@hallyn.com> Date: Wed, 3 May 2017 13:32:24 +0300 Message-ID: <149380754432.3812.6056635780417402774.stgit@localhost.localdomain> In-Reply-To: <149380742825.3812.2073418607639032138.stgit@localhost.localdomain> References: <149380742825.3812.2073418607639032138.stgit@localhost.localdomain> User-Agent: StGit/0.17.1-dirty MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit X-Originating-IP: [195.214.232.6] X-ClientProxiedBy: DB6PR0802CA0032.eurprd08.prod.outlook.com (10.172.252.146) To AM4PR0802MB2274.eurprd08.prod.outlook.com (10.172.218.7) X-MS-Office365-Filtering-Correlation-Id: d78b8782-b780-41a0-5f0f-08d4920fb25f X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(22001)(201703131423075)(201703031133081); SRVR:AM4PR0802MB2274; X-Microsoft-Exchange-Diagnostics: 1; AM4PR0802MB2274; 3:SZopyDqS0toNq4lKMkdkgz9l/x4+EoZBJbpbuZ8C0impUaEBJPAlECnezrn0yXuSQQNnOXGAxgHJEd8uCkAPztSXRhr9Us/kMwKl3wGUfWO9i1mTkyznObte7sDL5MuS1HqTTUCkCYOXjLk1El1XRlnBvUpVvIJLQDEwKi7CkFZvn1Oaz78UyfRp/79bGwIbnrxa54dli4yRgSxwEE6KOKC8SzXuUiNpJ9uoxJ+8vwcsg4aN7bRIz5iGW7HNZ4xmEvrusYiNV1RrYsD6S1KQx582r5oGkJSEbnTPH7cf/F3j10i1g6kPvCZLzyT7LjyPUU/k8+JahM/ja1EiumJfeA==; 25:BC2YEfsGcSt6VGX/gOrQwvdWGp4OD+q105cKTL1l5EZFbDUoCxhKN39IjI2F3VyyToc2gmUONVROFNKjvOgeQ3XcdqCLh/W935KOnkIBOU3Rcqh27X6fDVjXfnjkqGvhxVJK6MNZxS6NBYAuEQrK6UDx2lw+vU5b0+Bop+cD10Zgz0MRcXsJGUQrhHbjUFFl4tswMwG1pa0AKboCy2/jFbHfNq1MSThDPTEo/r4ZSxXt5oFhLLJfZNYIZaN6VrT77nx+9zRm+qgvmSIJGXBLzo6ry3UAbMpig9CRioxQJBZMni9tM0cB+idvf3vlWbvefN9wBnaIK8NMXMwEA+pjfN+qhqvqO7A/IwRI0Wp/UTYT6g3FT9J3kGfCV/3RRvvFZUVg083RJJLtGqlb94nXQXhuL/NRoJv8qKqvvBGZ0JPJld6nG7Usdde+aHPUzAO+rfXevsjDKmNb0sF0F/a6Yg== X-Microsoft-Exchange-Diagnostics: 1; AM4PR0802MB2274; 31:DjIPQ4SYYDyjul+ptcs4xHF8GwNRE27BiUSqhplH8MSHMatOengdwWyzLnRhRY1IPah4Q+j/sYl2OedE+OtQOn9CLln8PDV16AJcYtcRJ9xnjgsHOrf4P7tkgJATB3fAJL/Pkdc44+ROxWDD/ObJ4fqCtY5lDU8xALpgyT4LLPUWvCTp6sXO9sBXAopw6qdKC4h6dUFYTPzzhc+kMAqqcWn+rEUPOorlr+qsfbaZd0k=; 20:3EFg56Jm/JrXXDxE+KMVjyySu8JjEGrE72ErEsX8BuxBBNF6FHIZ52SwsMemkhfWfJjBsou6X4Zuz/qIzrNfXuJUJVaf2qCtiXkSO6tiOULhzByJ48M3skTCozEVCP1pLOpoQXrorV8MXc984Ur1CUC/+5UJlLIDy4JOHJorJOWqaQ7nf8hK4dSJcTZz2Hgo+bDLhPkaF4w0xFJl7nSjQ0EOK1wTPuimfuDrhGPhXigEf0ol8J1WoP7rP0rNAdPmANCzKVL6KBXIv326t0HPD2QJQ/6fMgwOSiAdzdA+5MCBnXjwdBoaQyH1vcao1UaDxM73ZtbUgP9hfCRMGojj6L7ESDbEmmJ8kMWh8UciAtM6KgzoLYj+x4a+RrthwIolbnc98DDubSwO6zf7PVgA8mhZZQdw54mixqVR6+fzs0Q= X-Microsoft-Antispam-PRVS: <AM4PR0802MB22746E0765E847B06D0831ADCD160@AM4PR0802MB2274.eurprd08.prod.outlook.com> X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(6040450)(601004)(2401047)(8121501046)(5005006)(93006095)(93001095)(10201501046)(3002001)(6041248)(20161123560025)(20161123555025)(20161123564025)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(20161123558100)(20161123562025)(6072148); SRVR:AM4PR0802MB2274; BCL:0; PCL:0; RULEID:; SRVR:AM4PR0802MB2274; X-Microsoft-Exchange-Diagnostics: 1; AM4PR0802MB2274; 4:g4SQL98ijs06ihP3a4ZuD0+0YQ3sgCdkYPSx32axMgNQSUM4jyIgeSHBcl2ViiPRYvpcQyQ2qeDC7Z3vdmWWnCawYHj/XtZFkl/DkyA2BgMH9skJOF7W4kOZFkWEVqMLZfwY5kY6sWQiST0z/w5vQ5yXg6uxb/+2lKQ/brFd9z7PDA+fEmgroUsHvv7hLdQ+cjmDnn5CCzjjrQbdqOYJDI/DaIh0f5j+AB5ABLbxcItgynKJa17dI8T5I2XAMOvw/2BiGOK5a4EQ7q1Z5aLmZCC1lMF0YBqsjKVZGde8+rDDCgtVEhUHLVvup/j/+TqIoEv+tqQc48lht+CSgXwFTDkwIDnX9W7NdRxYA6f1PPxOuGBTR7TcxULozGIJ3WliTI/khAV+Gl1tGGpzut3PAJR+TcDjh3l7FIONE0edKOUZ3YhXgvUmSVBsldqI1cqlevFFY2lZ3cVB36v59ZiEug+jCSCb/O0eTrXbGYqzqmNGpr7s2fQ4QI1+mbPlOhLfwE0Krnx9e8Vdddbqvy7NwqtH1An7xxi6my0sgPwyDKxt2c9nCHPQQx9TJz1t62/MA+PoqgvBtvfAZlb5fFSwmd1LK/Tv0WuLpEPwOEdurL4Hzr2Vymbd1PFuytxXlcXfRLo8SsFFMXpvltwAtOYiNVXLQP8YIr56izGV80D3EouvL/XB9ort7d09bl/SqGgRUx/68KQHByCn+0UGJ03LgrD88nS7g+0qo0ln9WEL6AU3mjafEzVGYysMw/ZjqPmWKkLoYIOrZRGLxG4FWg4TYI576DGbDLr2B4DaV1Dg5nY= X-Forefront-PRVS: 029651C7A1 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10019020)(4630300001)(6009001)(6069001)(39450400003)(39410400002)(39400400002)(39840400002)(2201001)(55016002)(6506006)(6116002)(9686003)(3846002)(33646002)(42186005)(478600001)(50986999)(86362001)(53936002)(2906002)(5660300001)(2950100002)(189998001)(4001350100001)(61506002)(230700001)(103116003)(25786009)(83506001)(50466002)(76176999)(23676002)(81166006)(8676002)(305945005)(66066001)(38730400002)(7416002)(7736002)(47776003)(54356999)(21314002)(921003)(1121003); DIR:OUT; SFP:1102; SCL:1; SRVR:AM4PR0802MB2274; H:localhost.localdomain; FPR:; SPF:None; MLV:nov; PTR:InfoNoRecords; LANG:en; X-Microsoft-Exchange-Diagnostics: =?utf-8?B?MTtBTTRQUjA4MDJNQjIyNzQ7MjM6eFRyMk1SZjZIamxWQW9EZVBLeFYyQ2lM?= =?utf-8?B?OCtldjNsOGdiR2RIdVJjMDdwNnpvWk5Za2tFc3dkL2hFeFE3aTZwQ282cjE2?= =?utf-8?B?OXVQM0JFRjc3ejhIcWswekthMTl5WjdSSFVSakF2cnNOcE5DM2M1blhJRGFo?= =?utf-8?B?ZHNrNHBRVHVPTk1YU0JiRzBRdHZoYnBNRDQ1dTgzQTJpbnErRG5aam4vVnRz?= =?utf-8?B?K0JhUVRqcTU5RFFvUzkvc0FZWlYyOGRWTndOUHNQZlA2TGk2RUhHU2hlYlJG?= =?utf-8?B?cnArcXpCU0RpdFlJZ2tyVDdoUWhXODBZNzdRdTZjeFFBVFFSWllvNzZSVXRC?= =?utf-8?B?NzRjQUhRN09QaDJEaVpIK1JPWjJGdGhhbG9rYkVsQ2s1RFVrek83VkljMTgw?= =?utf-8?B?NkZVazJBWkhLQ0hlaDd5d2dvT0VLcThnSHViTHdGVGpjOVlURnJPY015V29k?= =?utf-8?B?cEhjSzVBOWRzMTdGUmZWeEo0MStGL0pWcTNmeWdKSTlBdTlqMUZsS2d0b2cw?= =?utf-8?B?ZjZMS1pqSitRaU01dmpjdzZ1emtMM0kySDAxb2dzWCtzZElKZFJoaGlNWFhn?= =?utf-8?B?d0lXcmw3ZjVUUWpWYkFUUXFROGtVSDZqYjNmQlgyd3BOQXRSeUlEVnAzbEFF?= =?utf-8?B?NldTS0ZmQ2dNcTFaY2FrWGpIVkVBZ2drdHVPazh0WTJpQXBXRkVoR1E3RklC?= =?utf-8?B?VzN6ajV1QjdxM2lPWENGSFlnbjJabU16ZnJ4R28xQjNXanYwVkJzbDh4U1Zm?= =?utf-8?B?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20:1v9UgasJ4RPMenOmERt1Z5cty8jg97ZskJymgotEU7PO9CxWOx7f+GAj/+C4w0aKrz7V+ZCACeOwUO24JxDq1+CVIX8xkcS4r4pWBLrsxZEzeMLB9nbnU5MLXKmISLTcCSUAnYUQ//iLDlQN4VBG3/RxbIT3qlmtdJJGKQ9iv9k= X-OriginatorOrg: virtuozzo.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 03 May 2017 10:32:26.5178 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM4PR0802MB2274 Sender: linux-fsdevel-owner@vger.kernel.org Precedence: bulk List-ID: <linux-fsdevel.vger.kernel.org> X-Mailing-List: linux-fsdevel@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP |
diff --git a/fs/nsfs.c b/fs/nsfs.c index 323f492e0822..f3db56e83dd2 100644 --- a/fs/nsfs.c +++ b/fs/nsfs.c @@ -196,9 +196,11 @@ int ns_get_name(char *buf, size_t size, struct task_struct *task, { struct ns_common *ns; int res = -ENOENT; + const char *name; ns = ns_ops->get(task); if (ns) { - res = snprintf(buf, size, "%s:[%u]", ns_ops->name, ns->inum); + name = ns_ops->real_ns_name ? : ns_ops->name; + res = snprintf(buf, size, "%s:[%u]", name, ns->inum); ns_ops->put(ns); } return res; diff --git a/include/linux/proc_ns.h b/include/linux/proc_ns.h index 12cb8bd81d2d..88dba3b53375 100644 --- a/include/linux/proc_ns.h +++ b/include/linux/proc_ns.h @@ -14,6 +14,7 @@ struct inode; struct proc_ns_operations { const char *name; + const char *real_ns_name; int type; struct ns_common *(*get)(struct task_struct *task); void (*put)(struct ns_common *ns);