From patchwork Fri Jun 28 00:24:59 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Eric Sandeen X-Patchwork-Id: 13715205 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 9D4CEC2BD09 for ; Fri, 28 Jun 2024 00:25:08 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id F1E126B008A; Thu, 27 Jun 2024 20:25:07 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id ECE0C6B0096; Thu, 27 Jun 2024 20:25:07 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id DBCD46B0098; Thu, 27 Jun 2024 20:25:07 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0011.hostedemail.com [216.40.44.11]) by kanga.kvack.org (Postfix) with ESMTP id BC32F6B0096 for ; Thu, 27 Jun 2024 20:25:07 -0400 (EDT) Received: from smtpin22.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay10.hostedemail.com (Postfix) with ESMTP id 4AE8CC1167 for ; Fri, 28 Jun 2024 00:25:07 +0000 (UTC) X-FDA: 82278402654.22.D5076E2 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by imf06.hostedemail.com (Postfix) with ESMTP id 1F99A18000A for ; Fri, 28 Jun 2024 00:25:04 +0000 (UTC) Authentication-Results: imf06.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=CtHe6ESM; spf=pass (imf06.hostedemail.com: domain of sandeen@redhat.com designates 170.10.129.124 as permitted sender) smtp.mailfrom=sandeen@redhat.com; dmarc=pass (policy=none) header.from=redhat.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1719534297; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding:in-reply-to: references:dkim-signature; bh=Pht9Lfpad0vyg1Yyut9IEpvrjSRLNRr1y5QQbadsiGU=; b=6QEyEkX9lCTPExVivawwpsO7veaUvZa2NUq4T1Kn/IGXead/K3U8DVPCAeWPifxXot2bWU /kfoxc1hWFRmlnkAKV6FQkSiuSTgewMB0O/w5qc3H8OmfdRtKVHVuIPjv0ynkz4kmbzdlp yaL8yGXnCCAS+KCkJB2U5d+Zpt/w4ZU= ARC-Authentication-Results: i=1; imf06.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=CtHe6ESM; spf=pass (imf06.hostedemail.com: domain of sandeen@redhat.com designates 170.10.129.124 as permitted sender) smtp.mailfrom=sandeen@redhat.com; dmarc=pass (policy=none) header.from=redhat.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1719534297; a=rsa-sha256; cv=none; b=Cz4jYRJSmkDpbCu8fQDk6jS+Dem8vyCdJDbp/vPtuunl9I7gSkwX8LeIsxzDTiG17mUAJc cY+xCN/L6RI2FQgAwPkNxwMN844RlMra9gdfQhy0aDTy2ZFVkdv9GvGrwFvqTZ+CiETOpR OOp5MEmeJrpSNsv8M2joliDyZtwZdEA= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1719534304; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Pht9Lfpad0vyg1Yyut9IEpvrjSRLNRr1y5QQbadsiGU=; b=CtHe6ESM7aFxM7JBtRvWTufcO4zx+wXr5egZXbWGUq82ZFUk7GdLXNMiBsaY5P+GR7tTyx AHoeu1sJEm+rWkK0uxy0dp1GEkSAOTCOrHp1xwRGQSg8Z/A1N/PqoehgGp+o+rgoTiKyI8 HPQsno72ahpdZfLhjcR1TaYlYdUiWcM= Received: from mail-io1-f70.google.com (mail-io1-f70.google.com [209.85.166.70]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-271-0sEagUmRPXKskOUNKaGgrw-1; Thu, 27 Jun 2024 20:25:02 -0400 X-MC-Unique: 0sEagUmRPXKskOUNKaGgrw-1 Received: by mail-io1-f70.google.com with SMTP id ca18e2360f4ac-7eafdb25dbbso2682339f.3 for ; Thu, 27 Jun 2024 17:25:01 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1719534301; x=1720139101; h=content-transfer-encoding:subject:from:cc:to:content-language :user-agent:mime-version:date:message-id:x-gm-message-state:from:to :cc:subject:date:message-id:reply-to; bh=Pht9Lfpad0vyg1Yyut9IEpvrjSRLNRr1y5QQbadsiGU=; b=gOle1MzFxeecKi4js/sdFV/7+kn9bFcX4I0wHmIvVTH+5BuzBflrF6XSMRF045rL4n ChyYo8SPZdHNPu4qoVcelnYWQvWoZh9AwFo9Q1XY8tSUjRi5fNQ7sxQuKf/uPVzsmiVn q8SRTdNf3vADgH9YSPEn9V7DxXy0h3Q1Ds3uLZ1CkZ1AuiVNSBytuGxcmQT57ph3q126 dTtoAWNVTvbPsIxp4j0+c0s5GiP8T7kCHQtVP78uwD55NfAopUGuia6jDxx+Ts8m7Y1R 6hWuJEWgBuZYlln+oYtR9kj6YoacRjzvEfdrXfZSFhJ71cr0b5+TpuluF+fP/g65pfNV b4Hg== X-Forwarded-Encrypted: i=1; AJvYcCVX/U+6sTo37iRTrgVbyhiPFJmfdB05at4M/ywwdWk+fW5eKNF5U3NtOf1zHH/A2j8fPxARXgtjM8wyKh1xeIPSzpU= X-Gm-Message-State: AOJu0YzRzhFc046P7d/d0TqAKn/Xcon5HOSGeZxwODXbU+mhzzS6qC8E BeSpOLpKG9i6x2mIvYLktgFWkEiKFca3u2ZCafrTD+rcZDBxo+IpvEw7PzrjUJ/5Tgrfh2ToqpR KNDxnltgeBoAhn1MjR0Ax1x9cyG6OJr5X+1kKrp51/rV+Ry2S X-Received: by 2002:a05:6e02:b4b:b0:375:86bb:2142 with SMTP id e9e14a558f8ab-3763e0607bfmr185522585ab.24.1719534301024; Thu, 27 Jun 2024 17:25:01 -0700 (PDT) X-Google-Smtp-Source: AGHT+IH481kZ0wneyCG62Atf5OEAOI8SNnvN2mW4RtYhpSMGDQsWqiRmeiQ26Brky+7JgOdDtIxULw== X-Received: by 2002:a05:6e02:b4b:b0:375:86bb:2142 with SMTP id e9e14a558f8ab-3763e0607bfmr185522465ab.24.1719534300668; Thu, 27 Jun 2024 17:25:00 -0700 (PDT) Received: from [10.0.0.71] (sandeen.net. [63.231.237.45]) by smtp.gmail.com with ESMTPSA id e9e14a558f8ab-37ad4370c90sm1696895ab.69.2024.06.27.17.24.59 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 27 Jun 2024 17:25:00 -0700 (PDT) Message-ID: <8dca3c11-99f4-446d-a291-35c50ed2dc14@redhat.com> Date: Thu, 27 Jun 2024 19:24:59 -0500 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird To: linux-fsdevel@vger.kernel.org, Christian Brauner Cc: autofs@vger.kernel.org, "Rafael J. Wysocki" , linux-efi@vger.kernel.org, Namjae Jeon , linux-ext4@vger.kernel.org, Miklos Szeredi , linux-mm@kvack.org, Jan Kara , ntfs3@lists.linux.dev, linux-mm@kvack.org, linux-cifs@vger.kernel.org, linux-trace-kernel@vger.kernel.org, Hans Caniullan From: Eric Sandeen Subject: [PATCH 0/14] New uid & gid mount option parsing helpers X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Language: en-US X-Rspam-User: X-Rspamd-Server: rspam01 X-Rspamd-Queue-Id: 1F99A18000A X-Stat-Signature: y4owcz3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bq+dUGdfwlysqttPNpaft/7sg57YUR2/i2m2tRXoD587HJkM+LC4X2P4JaoJOHUOP1TWLLB9Ns6bMCb6Kcqk3LHrMCsOYBc16ExR5B7Nsdt3SlrxeuchjWRXiby5nrMH7HGsFph7+UPyDrhOHnQgkOx4CDlGF9OdoUHnx1Y8AmQL6Mqq0l/+Mh9SS8xXo/lP9ACIhpDAFkW4FbIIPjCTHixVjDL4kZ2Izz9T8kwcmseu5VMuLIcpkRkB2iGfmfdF1dpoBSx2zyCVRowUHAGLzqTQ7VHx3DAr9czbZRAJYlZAAQZGt0Z3yCP76vI821l7UlJKW2Rx8LvFb4+VKXiedZNYd5uMLuWiGYqsFgUgtPiJ+ur3/wUDfWiDoU8MeczQrLvPShg6gxtYgVoP+d+XuVVmyeEONbDDD5/sgsmqsXzbj5dLfdfh+J30hxOdLq6ctaDWPpZVHN X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: List-Subscribe: List-Unsubscribe: Multiple filesystems take uid and gid as options, and the code to create the ID from an integer and validate it is standard boilerplate that can be moved into common helper functions, so do that for consistency and less cut&paste. This also helps avoid the buggy pattern noted by Seth Jenkins at https://lore.kernel.org/lkml/CALxfFW4BXhEwxR0Q5LSkg-8Vb4r2MONKCcUCVioehXQKr35eHg@mail.gmail.com/ because uid/gid parsing will fail before any assignment in most filesystems. Net effect is a bit of code removal, as well. Patch 1 is the infrastructure change, then per-fs conversions follow, cc'd as appropriate. This series is also at https://git.kernel.org/pub/scm/linux/kernel/git/sandeen/linux.git/log/?h=mount-api-uid-helper Thanks, -Eric Documentation/filesystems/mount_api.rst | 9 +++++++-- fs/autofs/inode.c | 16 ++++------------ fs/debugfs/inode.c | 16 ++++------------ fs/efivarfs/super.c | 12 ++++-------- fs/exfat/super.c | 8 ++++---- fs/ext4/super.c | 22 ++++------------------ fs/fs_parser.c | 34 ++++++++++++++++++++++++++++++++++ fs/fuse/inode.c | 12 ++++-------- fs/hugetlbfs/inode.c | 12 ++++-------- fs/isofs/inode.c | 16 ++++------------ fs/ntfs3/super.c | 12 ++++-------- fs/smb/client/fs_context.c | 39 ++++++++++++--------------------------- fs/tracefs/inode.c | 16 ++++------------ include/linux/fs_parser.h | 6 +++++- mm/shmem.c | 12 ++++-------- 15 files changed, 102 insertions(+), 140 deletions(-)