Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp17953716ybl; Thu, 2 Jan 2020 15:31:42 -0800 (PST) X-Google-Smtp-Source: APXvYqzq5GWCbxpmgWeqhxX1l1gWOm6oXFsv69WCBkiNL1ksVSTnOrHHjuR+DIbUJlzFTdOdh+GX X-Received: by 2002:aca:a949:: with SMTP id s70mr3354619oie.80.1578007902258; Thu, 02 Jan 2020 15:31:42 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1578007902; cv=none; d=google.com; s=arc-20160816; b=P+sohbuQGQ6WzRGPbG1Ytn8aniPdtSYjkTprPeUAwZWutNrWTPHVag4o1wOvegT+XX XblCLP1f8oBVzQkU2zj+5bDdtaRqDCcrNByOOonobG1s6xkktZVTU+bWtMVnRcHPK1Y4 nhIHtXphnqiHOqzESFNE7noqGekMouRLkZVPOfJiU5K/xLUxnX5Z4bLpmd9mvmOBR53q 93I/kcBZMvWsQoPp9ghVbzZre84W5nvsQf+DJT2YPXIS0jKWiWoi+h+IAIvcpnG1Plnn 3QqG3UOA3mVw2pSFGkpznIu04gozYaps5o2jh4huPBzztbQVOkOLqWHUZ4sOr8DNZg1j 7GFw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:ironport-sdr:dkim-signature; bh=fXudtcU/ryZBawNrA9rWmGmiFpp6nuz0owgxhPvOAmI=; b=KBF9GsSUc2TvrPsxABXOgjb7tNO/A0CWMUi8vwZhcfwR9gPvSyb42YtETufTv6LevL jTDe9ceF+V4HmpesDU6Up1lQneutRHUrJdJVU34dQ2LFxTEx7XCM2MJQiHAwO6u0DzqF 7Jgq5gnWfA9UcACUmY4LhdDjwR2DBUEYSaJfcAutVV2Nz3vC4A3aSNmFWVWjOZPaszjM E0+8aX9iS+JQI3RzZTY4zqfHOXqdBxwUGNbxezZL7vauauRyBaHMiLRsIgnd81g3WOgq wv4M/pmjJuq7ID0ihCEfScyuCx1d2Ac86Ip3/pBd4OmqvLujWhAx1YfTZDnV1WoeFRLC yjpQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amazon.com header.s=amazon201209 header.b=JEgYoncN; spf=pass (google.com: best guess record for domain of linux-nfs-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-nfs-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=amazon.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id l10si21554020oil.224.2020.01.02.15.31.15; Thu, 02 Jan 2020 15:31:42 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-nfs-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@amazon.com header.s=amazon201209 header.b=JEgYoncN; spf=pass (google.com: best guess record for domain of linux-nfs-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-nfs-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=amazon.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726050AbgABXbO (ORCPT + 99 others); Thu, 2 Jan 2020 18:31:14 -0500 Received: from smtp-fw-6001.amazon.com ([52.95.48.154]:44298 "EHLO smtp-fw-6001.amazon.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726039AbgABXbO (ORCPT ); Thu, 2 Jan 2020 18:31:14 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amazon.com; i=@amazon.com; q=dns/txt; s=amazon201209; t=1578007873; x=1609543873; h=date:from:to:cc:subject:message-id:references: mime-version:in-reply-to; bh=fXudtcU/ryZBawNrA9rWmGmiFpp6nuz0owgxhPvOAmI=; b=JEgYoncNNfEP5x26yuApw5CMKLSYDvtdxjh5YfhB+W9ne6IoIGQcRwqU CPUPSI0Rl62esP1+stERREuckdFkshEcijMxs5fDxZRUP8Q4VsdIApSdD IpbNB/Z9ZpUl871bBBKsvpouQSCJZ1ZnjbebzgaCGWfvZuYJnaomTz7J9 Y=; IronPort-SDR: 7hLUdf6+W/hbVue1v7zts+KaeEl3RciCKVH7wHJXe2d9LhLBjMfm3s1rvgQaCfU13qdg8k3grt xMHcqQWATTPg== X-IronPort-AV: E=Sophos;i="5.69,388,1571702400"; d="scan'208";a="11342942" Received: from iad12-co-svc-p1-lb1-vlan3.amazon.com (HELO email-inbound-relay-2b-baacba05.us-west-2.amazon.com) ([10.43.8.6]) by smtp-border-fw-out-6001.iad6.amazon.com with ESMTP; 02 Jan 2020 23:31:11 +0000 Received: from EX13MTAUWB001.ant.amazon.com (pdx4-ws-svc-p6-lb7-vlan2.pdx.amazon.com [10.170.41.162]) by email-inbound-relay-2b-baacba05.us-west-2.amazon.com (Postfix) with ESMTPS id 25B64A1BFA; Thu, 2 Jan 2020 23:31:10 +0000 (UTC) Received: from EX13MTAUWB001.ant.amazon.com (10.43.161.207) by EX13MTAUWB001.ant.amazon.com (10.43.161.207) with Microsoft SMTP Server (TLS) id 15.0.1367.3; Thu, 2 Jan 2020 23:31:10 +0000 Received: from dev-dsk-fllinden-2c-c1893d73.us-west-2.amazon.com (172.23.141.97) by mail-relay.amazon.com (10.43.161.249) with Microsoft SMTP Server id 15.0.1367.3 via Frontend Transport; Thu, 2 Jan 2020 23:31:10 +0000 Received: by dev-dsk-fllinden-2c-c1893d73.us-west-2.amazon.com (Postfix, from userid 6262777) id 58865C28B0; Thu, 2 Jan 2020 23:31:10 +0000 (UTC) Date: Thu, 2 Jan 2020 23:31:10 +0000 From: Frank van der Linden To: Olga Kornievskaia CC: Andreas Gruenbacher , "J. Bruce Fields" , linux-nfs Subject: Re: extended attributes limitation of xattr_size_max Message-ID: <20200102233109.GA8735@dev-dsk-fllinden-2c-c1893d73.us-west-2.amazon.com> References: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.11.4 (2019-03-13) Sender: linux-nfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-nfs@vger.kernel.org On Thu, Jan 02, 2020 at 05:28:44PM -0500, Olga Kornievskaia wrote: > Hi Andreas and Bruce, > > I thought of you folks as somebody who might have a strong opinion on > the topic. Right now an NFS client is limited to setting and getting > ACLs that can't be larger than 64K (XATTR_SIZE_MAX) (where some NFS > server don't have such limit on the ACL size). There are limits in > fs/xattr.c during getting and setting xattrs. I believe that's because > linux local xattr system is limited to that particular constraint. > However, an NFS acl that uses the xattr interface can be larger than > that. Is it at all possible to suggest to the larger FS community to > remove those limits or would that be a non-starter? > > diff --git a/fs/xattr.c b/fs/xattr.c > index 90dd78f..52a3f91 100644 > --- a/fs/xattr.c > +++ b/fs/xattr.c > @@ -428,8 +428,6 @@ int __vfs_setxattr_noperm(struct dentry *dentry, > const char *name, > return error; > > if (size) { > - if (size > XATTR_SIZE_MAX) > - return -E2BIG; > kvalue = kvmalloc(size, GFP_KERNEL); > if (!kvalue) > return -ENOMEM; > @@ -528,8 +526,6 @@ static int path_setxattr(const char __user *pathname, > return error; > > if (size) { > - if (size > XATTR_SIZE_MAX) > - size = XATTR_SIZE_MAX; > kvalue = kvzalloc(size, GFP_KERNEL); > if (!kvalue) > return -ENOMEM; Aside from not wanting to allocate a raw amount of kernel memory based on a system call parameter without any checks, I support the idea :-) The internal xattr interface can be a little awkward to deal with, the static upper limit being one of the issues that caused me some problems when implementing user xattrs for NFS. In general, I would love to see paged-based xattr kernel interfaces, treating extended attributes as a secondary data stream, which would make caching fit in a lot more naturally, and means all FS-specific caching implementations could be removed in favor of a generic one. One issue right now is that, an xattr not being a 'stream', a lot of FS code caches the entire value in kmalloc-ed space, which becomes unwieldy if the XATTR_SIZE_MAX limit is removed. In other words, I think removing the limit won't work that well with the current implementation, but I hope that the implementation can be changed so that the limit can be removed. - Frank