Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp331474pxb; Wed, 3 Feb 2021 06:42:04 -0800 (PST) X-Google-Smtp-Source: ABdhPJyHoCx+AsKwKtVXeaCcYQwRLplA4+YAjl87WNt0qK1hiqVZS32Xe4GAi6QM5iCOREOWUYms X-Received: by 2002:aa7:dc17:: with SMTP id b23mr3321057edu.139.1612363324016; Wed, 03 Feb 2021 06:42:04 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1612363324; cv=none; d=google.com; s=arc-20160816; b=QXWoFeGRwE32PIgtLWuk6yC+D4juSSpSboo0jAoPJu8c3CQ2S2QAxNTPrdiTeqAdyd QKpJarf85XWEAONJ+iRb4rXfHCtCyoOmYMysOHzqaYNffAT85kpkwzJxX+FDaeG6wSZf kst9REaA1Z3ey2PJiM8dhho0Oj7hS66k35EiyhGn0eGZCKzGAIVHMkmDXfynlpFEX36u FOd1yeNtpqMK7ehVfFPIsi/aZejpEyUrVyVppKKx1m9wyX9DI2fJqh3WGPFBbQCsi558 kmTWxrB3Rb6eRcsO7j+K8SvkZBdMS25NNZeoHsSlQttV8N8aiRLcZa1zidXItNQQHIMv IqZQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=gW5gHlZvvZ0E3mwnAn4SmU4riSNDauzI8Ays9OXlQLA=; b=p5j80w9poMiAnf8i3HL8IzGhBMUyblturSstPOdkzw3WUOF4sgX3tDs/ZfGdpb/i4A JdlRd6mzYipAdRJzLYoGeyPLGuLfAcWRnGnOfV2WwkCZ/yupczH/ldo8WEJYqZzFMJA8 S+ICTlilIfdAOp2OYsaT7cAFS0owQla8s2F+YJB2XUtnTV6qF1A3w4YSYaBjVcN4XgOX cmyoAawc0w3O6Rxl7OzS+Mbbf0GpRpt1uArykVxY3pBN1BIoBNQ8Z0Vshz7xB2zU7gHj Q86OHKdUJM77ec7X891IaZbnr8qxzPNZEF2CVrz/SehwYsB9kNTV+KnSPGmvMApVtY9V PMqQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=temperror (no key for signature) header.i=@szeredi.hu header.s=google header.b=cKQP+2s3; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id y9si1259820edw.319.2021.02.03.06.41.33; Wed, 03 Feb 2021 06:42:03 -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=temperror (no key for signature) header.i=@szeredi.hu header.s=google header.b=cKQP+2s3; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233050AbhBCOk0 (ORCPT + 99 others); Wed, 3 Feb 2021 09:40:26 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57372 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232817AbhBCOjr (ORCPT ); Wed, 3 Feb 2021 09:39:47 -0500 Received: from mail-vs1-xe32.google.com (mail-vs1-xe32.google.com [IPv6:2607:f8b0:4864:20::e32]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D5CA9C0613ED for ; Wed, 3 Feb 2021 06:39:06 -0800 (PST) Received: by mail-vs1-xe32.google.com with SMTP id d14so1741063vsh.11 for ; Wed, 03 Feb 2021 06:39:06 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=szeredi.hu; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=gW5gHlZvvZ0E3mwnAn4SmU4riSNDauzI8Ays9OXlQLA=; b=cKQP+2s3Ps2xDgPvQCH4c6d1cBbDj1uCyjJiVKAXpqtl0+ifzBpAtKIAu43a1Jb5s2 49FblmdIPmGV+d+l7SaOtx3l9YGbntQ4uyENhDzvwreNxnW4gW8AajHrgsaaYn+EfaJs 7rW7QsH4DOpZaz9UXWN511uJQi1zwvcmwvbg4= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=gW5gHlZvvZ0E3mwnAn4SmU4riSNDauzI8Ays9OXlQLA=; b=KoMzHDwK51HxH/BnoQcjL7km2ixVgBZjYRsh/jK3Xv5qXT5PTxH6AGQcX5GcqtENc8 /DRx+cuuCtik+iVfOKlum8ddZsha0A/6HRSEdw6eSTVRewBQCep4PR5n0K7z07qm7OQV Pi5mQufuSS7N+9+ta148aZ9dhC2qkW9BXmT3uM0BAMLNS7AZ/6xRWDX+4AORtZX3iElF 3AOwVCPH1Nm23/Zy0dvaaS8kkwcn1Gq7RwKSC6cgKJV3O78o1D3mMPub33CnzbyakZ3/ XWE1OjY3NLR4hIoizbwnHFnLcZQH8VQ9UalEUzBa8bmufnGcqkFjqNnDWKgwwvMG3c2Y gURQ== X-Gm-Message-State: AOAM531jrKzf0CK9VPRSaFGex+aJ1xvoFnjc0FM4ABuv2GsMNmSlBoUD zHqbJj7l32lM7lOwU0jy726Zf4aqv0+Oybpgv8sEhA== X-Received: by 2002:a67:ea05:: with SMTP id g5mr1707706vso.47.1612363146079; Wed, 03 Feb 2021 06:39:06 -0800 (PST) MIME-Version: 1.0 References: <20210203124112.1182614-1-mszeredi@redhat.com> <20210203130501.GY308988@casper.infradead.org> <20210203135827.GZ308988@casper.infradead.org> <20210203142802.GA308988@casper.infradead.org> In-Reply-To: <20210203142802.GA308988@casper.infradead.org> From: Miklos Szeredi Date: Wed, 3 Feb 2021 15:38:54 +0100 Message-ID: Subject: Re: [PATCH 00/18] new API for FS_IOC_[GS]ETFLAGS/FS_IOC_FS[GS]ETXATTR To: Matthew Wilcox Cc: Miklos Szeredi , linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, Al Viro , Andreas Dilger , Andreas Gruenbacher , Christoph Hellwig , "Darrick J . Wong" , Dave Kleikamp , David Sterba , Jaegeuk Kim , Jan Kara , Joel Becker , Matthew Garrett , Mike Marshall , Richard Weinberger , Ryusuke Konishi , "Theodore Ts'o" , Tyler Hicks Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Feb 3, 2021 at 3:28 PM Matthew Wilcox wrote: > > On Wed, Feb 03, 2021 at 03:13:29PM +0100, Miklos Szeredi wrote: > > On Wed, Feb 3, 2021 at 2:58 PM Matthew Wilcox wrote: > > > > > Network filesystems frequently need to use the credentials attached to > > > a struct file in order to communicate with the server. There's no point > > > fighting this reality. > > > > IDGI. Credentials can be taken from the file and from the task. In > > this case every filesystem except cifs looks at task creds. Why are > > network filesystem special in this respect? > > I don't necessarily mean 'struct cred'. I mean "the authentication > that the client has performed to the server". Which is not a per-task > thing, it's stored in the struct file, which is why we have things like > > int (*write_begin)(struct file *, struct address_space *mapping, > loff_t pos, unsigned len, unsigned flags, > struct page **pagep, void **fsdata); > > disk filesystems ignore the struct file argument, but network filesystems > very much use it. Fine for file I/O. That's authorized at open time for all filesystems, not just network ones. Not fine for metadata operations (IMO). I.e. ->[gs]etattr() don't take a file argument either, even though on the uAPI there are plenty of open file based variants. Thanks, Miklos