Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp3222870pxu; Sun, 29 Nov 2020 19:43:41 -0800 (PST) X-Google-Smtp-Source: ABdhPJzrbuMxd3Tyn61/4aWNlGY9eGrSEMP7jCFzd5f9pWso6WhHQayvdbz+AYmXsZEDGMSRMoH1 X-Received: by 2002:a05:6402:d0a:: with SMTP id eb10mr9440343edb.305.1606707821249; Sun, 29 Nov 2020 19:43:41 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1606707821; cv=none; d=google.com; s=arc-20160816; b=uc4eBkjSX6sjDko+rdaAsiEkPXNIue+tcX1c2bDCwZ87+6X82jI7OvwnWByLalvtv8 +Uy98zlTWtCerV8SgtvUMciZZSW7jTsF+FlJ+hC+vibfiXqGwUYa4RnloE1Pqzs/VCEh Qmyztt3bIK/f/qvHBAqsOB5aHwYhPUMSgJP/w/Qk3BC3F+dbjuZSUPxHTd9vzjS4oisY BCdf8G74m6i+FpT9hcovBDg3xOjLjIJCn/NeeKuvzT6h2G5/IS0NX70Qt3NMWnG2e68z HmTlpNAY/O2kwv/NsaaOOz6Q6didGLwug5XS7+UgyOqpqUrdswGgahcnb1rY4j9X9cHU nKrQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=Jhc+lVkqsX84CmnCJgcMdvNeWtYbhuxZA6U1hGDfCGs=; b=oGKFzgsInw/N2Rpilj+M8y2dzVUGXqZGLyjmgg1QOYqbKJBsCUh3gOqHq0GPI9M4Tg 8uaq+jVgjh1fN+IFbfwzppzSzO/5NiARJStMb7rOtnROBJKwkCqdJbw+USt5mJEDuy3M uipco6RwOnrqPdM/KrHuFdSUfypr+xoSUBejm35odW6IYUcy3kiByUy375dXox9pTVvq 4rRhKk8em5wI3TvVnuRs7s1wK0GS2VbCw1znPSgpDIqPqSluucAnU3Qq6xP6C/SJAuTA m+eFYT84ncmsytb1m4mKc53guWZNLMF49BqG1VkwSfZ/Gg0/sqnzbYEPeZ3lLbQW6Bx5 IStA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=sr5bOr50; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id f16si7522941ejw.747.2020.11.29.19.43.16; Sun, 29 Nov 2020 19:43:41 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=sr5bOr50; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727103AbgK3Din (ORCPT + 99 others); Sun, 29 Nov 2020 22:38:43 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60054 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726304AbgK3Dim (ORCPT ); Sun, 29 Nov 2020 22:38:42 -0500 Received: from mail-pg1-x544.google.com (mail-pg1-x544.google.com [IPv6:2607:f8b0:4864:20::544]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id AD43FC0613CF for ; Sun, 29 Nov 2020 19:38:02 -0800 (PST) Received: by mail-pg1-x544.google.com with SMTP id o4so6989609pgj.0 for ; Sun, 29 Nov 2020 19:38:02 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=Jhc+lVkqsX84CmnCJgcMdvNeWtYbhuxZA6U1hGDfCGs=; b=sr5bOr50tz6ihMGBHJWaQvOhIk8Bg1X0QcALns6jQeSuYfKCKOwkjys6p28+ANBkXs sPXVqph13y9tIu1ymUSN+KlVm/FbyHUf7sjCI7xgjyQQPNJOFjg6TVwThUHrF6fvV1bf 9VLjExX0ZVuWmHE/jaXZzP1e5nMwsCvvIi6l1PoClPWxVMafi1PloU85hdqCBxIB8ZwZ hiToySufRSkARd/n87MR0F5wClOVoWgHn9DQ4xUtwAlfYo8z5RSIPDU+TABG4GitgXMV 6aeklxLi6g4D7HvLUasFZpsWa6pfM+uy2VXLpu4E/BTjBepw3CQGB276F343u1K5xrK7 TBuQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=Jhc+lVkqsX84CmnCJgcMdvNeWtYbhuxZA6U1hGDfCGs=; b=OF+nQ1SrOcQjtPJlHw/hlTvC8fLgmODJkfj9MPnAWQbs5GRVEvZjO/WzwNMWLLaRKF 8sWiZUWWSv92Jkt9KeZNdE2wwHRAZO8bQZkA3poigEKHwLuEk/qanReeFSOAvQlH8SrY Xm+qUl5lM5w8KOvJHazBeIMg3YgGnGsUrE2u3xNPh0CGG0nqkKTZuP9nuvThKHeoYsp0 PYKITPQVCyU11sOWL15Vfygz25/XeX8Adu95GnjoU0y+W1fljReH8U5AoHzbju0G5C88 EFQ+M+IcTtUXRyQx4Wov9jAYdj+r5w+hV5zaNVaZCC3FBdaW5cCLHRfWpZR+V81+2GNE Ln8Q== X-Gm-Message-State: AOAM530v21lHgV5TL6VrRRv5Cw0LGOa9mGK+dC/G6pL3LgY+XbXO9Vrp F4MZPGHU4m813QKmrf3qyYU= X-Received: by 2002:a63:5664:: with SMTP id g36mr15874386pgm.33.1606707481029; Sun, 29 Nov 2020 19:38:01 -0800 (PST) Received: from localhost ([2409:10:2e40:5100:6e29:95ff:fe2d:8f34]) by smtp.gmail.com with ESMTPSA id f18sm14786936pfa.167.2020.11.29.19.37.59 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 29 Nov 2020 19:38:00 -0800 (PST) Date: Mon, 30 Nov 2020 12:37:58 +0900 From: Sergey Senozhatsky To: Randy Dunlap Cc: Christoph Hellwig , "Gustavo A. R. Silva" , Namjae Jeon , linux-kernel@vger.kernel.org, Sergey Senozhatsky Subject: Re: [PATCH] posix_acl.h: define missing ACL functions on non-posix-acl build Message-ID: References: <20201130014404.36904-1-sergey.senozhatsky@gmail.com> <5b015b83-f183-526a-94e7-029f4c98b30b@infradead.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org A quick question, shouldn't there be dummy definitions for the EXPORT_SYMBOL-s? So that external modules can be modprobed and used. Some of posix_acl exported symbols have dummy definitions, others don't. E.g. posix_acl_create() is exported symbol and it's defined for both FS_POSIX_ACL and !FS_POSIX_ACL. While exported set_posix_acl() is defined only for FS_POSIX_ACL config. --- diff --git a/include/linux/posix_acl.h b/include/linux/posix_acl.h index 90797f1b421d..8a6c77a69761 100644 --- a/include/linux/posix_acl.h +++ b/include/linux/posix_acl.h @@ -59,19 +59,19 @@ posix_acl_release(struct posix_acl *acl) /* posix_acl.c */ +extern int posix_acl_permission(struct inode *, const struct posix_acl *, int); + +extern struct posix_acl *get_posix_acl(struct inode *, int); + +#ifdef CONFIG_FS_POSIX_ACL extern void posix_acl_init(struct posix_acl *, int); extern struct posix_acl *posix_acl_alloc(int, gfp_t); -extern int posix_acl_valid(struct user_namespace *, const struct posix_acl *); -extern int posix_acl_permission(struct inode *, const struct posix_acl *, int); -extern struct posix_acl *posix_acl_from_mode(umode_t, gfp_t); extern int posix_acl_equiv_mode(const struct posix_acl *, umode_t *); +extern struct posix_acl *posix_acl_from_mode(umode_t, gfp_t); extern int __posix_acl_create(struct posix_acl **, gfp_t, umode_t *); extern int __posix_acl_chmod(struct posix_acl **, gfp_t, umode_t); - -extern struct posix_acl *get_posix_acl(struct inode *, int); extern int set_posix_acl(struct inode *, int, struct posix_acl *); - -#ifdef CONFIG_FS_POSIX_ACL +extern int posix_acl_valid(struct user_namespace *, const struct posix_acl *); extern int posix_acl_chmod(struct inode *, umode_t); extern int posix_acl_create(struct inode *, umode_t *, struct posix_acl **, struct posix_acl **); @@ -91,18 +91,61 @@ static inline void cache_no_acl(struct inode *inode) inode->i_acl = NULL; inode->i_default_acl = NULL; } + +struct posix_acl *get_acl(struct inode *inode, int type); #else +static inline void posix_acl_init(struct posix_acl *, int) +{ +} + +static inline struct posix_acl *posix_acl_alloc(int, gfp_t) +{ + return NULL; +} + +static inline int posix_acl_valid(struct user_namespace *, + const struct posix_acl *) +{ + return 0; +} + +static inline int posix_acl_equiv_mode(const struct posix_acl *, umode_t *) +{ + return 0; +} + +static inline struct posix_acl *posix_acl_from_mode(umode_t, gfp_t) +{ + return NULL; +} + static inline int posix_acl_chmod(struct inode *inode, umode_t mode) { return 0; } +static inline int set_posix_acl(struct inode *, int, struct posix_acl *) +{ + return 0; +} + #define simple_set_acl NULL static inline int simple_acl_create(struct inode *dir, struct inode *inode) { return 0; } + +static inline int __posix_acl_create(struct posix_acl **, gfp_t, umode_t *) +{ + return 0; +} + +static inline int __posix_acl_chmod(struct posix_acl **, gfp_t, umode_t) +{ + return 0; +} + static inline void cache_no_acl(struct inode *inode) { } @@ -117,8 +160,38 @@ static inline int posix_acl_create(struct inode *inode, umode_t *mode, static inline void forget_all_cached_acls(struct inode *inode) { } + +static inline struct posix_acl *get_cached_acl(struct inode *inode, int type) +{ + return NULL; +} + +static inline struct posix_acl *get_cached_acl_rcu(struct inode *inode, + int type) +{ + return NULL; +} + +static inline void set_cached_acl(struct inode *inode, int type, + struct posix_acl *acl) +{ +} + +static inline void forget_cached_acl(struct inode *inode, int type) +{ +} + +static inline struct posix_acl *get_acl(struct inode *inode, int type) +{ + return NULL; +} + +static inline int posix_acl_update_mode(struct inode *, umode_t *, + struct posix_acl **) +{ + return 0; +} #endif /* CONFIG_FS_POSIX_ACL */ -struct posix_acl *get_acl(struct inode *inode, int type); #endif /* __LINUX_POSIX_ACL_H */