From patchwork Sun Feb 19 02:07:47 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bruce Fields X-Patchwork-Id: 9581439 Return-Path: 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 E2D3260589 for ; Sun, 19 Feb 2017 02:08:52 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id D4F78287C1 for ; Sun, 19 Feb 2017 02:08:52 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id C9A49287C2; Sun, 19 Feb 2017 02:08:52 +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=-6.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=ham 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 802A9287C1 for ; Sun, 19 Feb 2017 02:08:52 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1750812AbdBSCIe (ORCPT ); Sat, 18 Feb 2017 21:08:34 -0500 Received: from fieldses.org ([173.255.197.46]:35990 "EHLO fieldses.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751214AbdBSCI0 (ORCPT ); Sat, 18 Feb 2017 21:08:26 -0500 Received: by fieldses.org (Postfix, from userid 2815) id 1281D28C8; Sat, 18 Feb 2017 21:07:53 -0500 (EST) From: "J. Bruce Fields" To: Trond Myklebust , Anna Schumaker Cc: linux-nfs@vger.kernel.org, Andreas Gruenbacher , Weston Andros Adamson , "J. Bruce Fields" Subject: [PATCH 3/6] NFSv4: minor acl caching policy documentation Date: Sat, 18 Feb 2017 21:07:47 -0500 Message-Id: <1487470070-32358-4-git-send-email-bfields@redhat.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1487470070-32358-1-git-send-email-bfields@redhat.com> References: <1487470070-32358-1-git-send-email-bfields@redhat.com> Sender: linux-nfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-nfs@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: "J. Bruce Fields" Signed-off-by: J. Bruce Fields --- fs/nfs/nfs4proc.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/fs/nfs/nfs4proc.c b/fs/nfs/nfs4proc.c index 60501e10625d..a4e33e519f6e 100644 --- a/fs/nfs/nfs4proc.c +++ b/fs/nfs/nfs4proc.c @@ -5035,12 +5035,18 @@ static inline ssize_t nfs4_read_cached_acl(struct inode *inode, char *buf, size_ return ret; } +/* + * We don't cache ACLs over a certain size. I don't know if we have any + * real reason for this policy: + */ +#define NFS4_MAX_CACHED_ACL PAGE_SIZE + static void nfs4_write_cached_acl(struct inode *inode, struct page **pages, size_t pgbase, size_t acl_len) { struct nfs4_cached_acl *acl; size_t buflen = sizeof(*acl) + acl_len; - if (buflen <= PAGE_SIZE) { + if (buflen <= NFS4_MAX_CACHED_ACL) { acl = kmalloc(buflen, GFP_KERNEL); if (acl == NULL) goto out;