From patchwork Fri Jun 28 00:35:12 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Eric Sandeen X-Patchwork-Id: 13715266 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 317DCC2BD09 for ; Fri, 28 Jun 2024 00:35:20 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id BA6B86B009E; Thu, 27 Jun 2024 20:35:19 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id B54856B009F; Thu, 27 Jun 2024 20:35:19 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 9F3F16B00A0; Thu, 27 Jun 2024 20:35:19 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0014.hostedemail.com [216.40.44.14]) by kanga.kvack.org (Postfix) with ESMTP id 80A576B009E for ; Thu, 27 Jun 2024 20:35:19 -0400 (EDT) Received: from smtpin09.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay02.hostedemail.com (Postfix) with ESMTP id 20086120135 for ; Fri, 28 Jun 2024 00:35:19 +0000 (UTC) X-FDA: 82278428358.09.ADAE4E0 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by imf07.hostedemail.com (Postfix) with ESMTP id 0753640007 for ; Fri, 28 Jun 2024 00:35:16 +0000 (UTC) Authentication-Results: imf07.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=AQJNWdiD; spf=pass (imf07.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=1719534900; 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:in-reply-to:references:references:dkim-signature; bh=/uXKmUT/nwyBhbjHXhbeGwv5exw7uxZHD87X7TVS31A=; b=iYJ7z6hmxUO/7kXlRxJfHmUJdbSHX7B4aYNwBC6gd55rcVFDWHvu5cLwixftE+72DvheQg GU4opuy3N8ALOYjtF82ghe6aRzR0R2sSiD2VOWsiPJEP1cpf48PfmbK1dtbkpNouhByKBc Xf6giHb/gza7Xe7r6SPSq7mRAxaOsis= ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1719534900; a=rsa-sha256; cv=none; b=RzBwyMwaH4XTFcSdFx5mcDlbFEiV/jebM5mLnuA8WhXVRcmkcn3vDKpsxARZ18Pf+tVEGq mBFAlJkP37N6yJsFGcHYCy+W7DNRQtXOqSXQNH/Mhs5nnZfLzzKQzCMeUEd4p+5GTo2opU GdR5tFaaTYsytQmy09fS/9kKGkmUQl4= ARC-Authentication-Results: i=1; imf07.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=AQJNWdiD; spf=pass (imf07.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 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1719534916; 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: in-reply-to:in-reply-to:references:references; bh=/uXKmUT/nwyBhbjHXhbeGwv5exw7uxZHD87X7TVS31A=; b=AQJNWdiDupx+0nEFdDyuzPWc+lJUIQTOoiUYT3ei5blhm5/82EcoDl9xbagD3KU0oLkV7W 5n8RBAl4lFZ3MvFm2429mYh5tLhf3Ma7rEaj+4zPwiXfGlJxlLATykwO/0/eDjH2bSgxom /5fDf0DrfztIzQtGc4qSFztzcF18IyQ= Received: from mail-io1-f72.google.com (mail-io1-f72.google.com [209.85.166.72]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-329-rfDdJcEjO8GQQaPfgTejhw-1; Thu, 27 Jun 2024 20:35:14 -0400 X-MC-Unique: rfDdJcEjO8GQQaPfgTejhw-1 Received: by mail-io1-f72.google.com with SMTP id ca18e2360f4ac-7eb73f0683cso3618139f.2 for ; Thu, 27 Jun 2024 17:35:14 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1719534914; x=1720139714; h=content-transfer-encoding:in-reply-to:content-language:references :cc:to:from:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=/uXKmUT/nwyBhbjHXhbeGwv5exw7uxZHD87X7TVS31A=; b=kcPg5bus9hMB3hOiVaNvbTedPsIFWEJocM5lFPMMYin4Wnx7ptiKgUW0hNsbCLj7Ew z3Duj3R2Ej0YX9IVmTfDIHRzPgfOn+JPnYCWgEJIbKi2OUpfxMARC1MEvyefmH+uEtzy 4adQqHa3caeyeeT94n6phfbIABWy/6X+gdm0DDREB5dNjrVz+qjWSqPBbFxzopymQs/Y aTbPcLF3VotKd2sU9ax2MfmM0BBXcrY4qNP6pCpDAiN07D5IV4jpP30nsH9uh5ZkslfO 1Lt4D/Acf7HbmQI66I3mVhDM2ILcj8tYtM6I/9HbXJTNmugiU7HM6gUIuXlDLh1TK1mb /Nxg== X-Gm-Message-State: AOJu0YzmuEBcA7xvzLQobEN9Eta5lLwhw52HaznRJzgNOY7+herOYMep E3AuxhcAWCCQ0R2hsQiEbA+5urcrAifaX2i6EhqFUk/dTcqbrAUMfMMGDkteHJpIG2SoT4wGtDs wHd40MvI8qlc9dgJzj/AAMgP+/x2k4nFPd3RYSrhvI54d9fMDCpYDJ8YZ X-Received: by 2002:a05:6602:2cd5:b0:7f3:d2d5:f06a with SMTP id ca18e2360f4ac-7f3d2d5f2acmr847379539f.13.1719534913865; Thu, 27 Jun 2024 17:35:13 -0700 (PDT) X-Google-Smtp-Source: AGHT+IE5bkzdQWyhKslA1Bbi7lsK+W3KJetd3xDc9zpQWMVm09ROQZ7lBfg0thxSlPP3X/rVq2ScLQ== X-Received: by 2002:a05:6602:2cd5:b0:7f3:d2d5:f06a with SMTP id ca18e2360f4ac-7f3d2d5f2acmr847378239f.13.1719534913643; Thu, 27 Jun 2024 17:35:13 -0700 (PDT) Received: from [10.0.0.71] (sandeen.net. [63.231.237.45]) by smtp.gmail.com with ESMTPSA id 8926c6da1cb9f-4bb73dd71easm224905173.62.2024.06.27.17.35.13 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 27 Jun 2024 17:35:13 -0700 (PDT) Message-ID: <6cb0dcfd-f837-463f-b5ec-0e7d2608b837@redhat.com> Date: Thu, 27 Jun 2024 19:35:12 -0500 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: [PATCH 08/14] hugetlbfs: Convert to new uid/gid option parsing helpers From: Eric Sandeen To: linux-fsdevel@vger.kernel.org, Christian Brauner Cc: linux-mm@kvack.org References: <8dca3c11-99f4-446d-a291-35c50ed2dc14@redhat.com> In-Reply-To: <8dca3c11-99f4-446d-a291-35c50ed2dc14@redhat.com> X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Language: en-US X-Rspamd-Queue-Id: 0753640007 X-Stat-Signature: xf4cnj5g6fyogx5o4onbmk9pik3j1g1r X-Rspamd-Server: rspam09 X-Rspam-User: X-HE-Tag: 1719534916-525014 X-HE-Meta: U2FsdGVkX1/35IsmzulQStO47QJW7KB8rLGPz0AwOE7kPqBO1Ya9vaoHUOrG+Etm9MqEiyxrcZONLp8ETX6NE73cs9LnfTxpJ1OkxJE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6U3hmdsrh2Rmht/0LgxZb6R9TF0Mxamv0Pi2iH9uyO8N1JzhETS1IlYL/DpfrA9Zu9E2xi8lbf6hz37MFsO7HDdhlItj0+4fUe+ddhn7Qr3J/GoU6bOtmW7OzSN5ua5bJZxkN/w= X-Bogosity: Ham, tests=bogofilter, spamicity=0.000805, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: List-Subscribe: List-Unsubscribe: Convert to new uid/gid option parsing helpers Signed-off-by: Eric Sandeen --- fs/hugetlbfs/inode.c | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/fs/hugetlbfs/inode.c b/fs/hugetlbfs/inode.c index 412f295acebe..81dab95f67ed 100644 --- a/fs/hugetlbfs/inode.c +++ b/fs/hugetlbfs/inode.c @@ -73,13 +73,13 @@ enum hugetlb_param { }; static const struct fs_parameter_spec hugetlb_fs_parameters[] = { - fsparam_u32 ("gid", Opt_gid), + fsparam_gid ("gid", Opt_gid), fsparam_string("min_size", Opt_min_size), fsparam_u32oct("mode", Opt_mode), fsparam_string("nr_inodes", Opt_nr_inodes), fsparam_string("pagesize", Opt_pagesize), fsparam_string("size", Opt_size), - fsparam_u32 ("uid", Opt_uid), + fsparam_uid ("uid", Opt_uid), {} }; @@ -1376,15 +1376,11 @@ static int hugetlbfs_parse_param(struct fs_context *fc, struct fs_parameter *par switch (opt) { case Opt_uid: - ctx->uid = make_kuid(current_user_ns(), result.uint_32); - if (!uid_valid(ctx->uid)) - goto bad_val; + ctx->uid = result.uid; return 0; case Opt_gid: - ctx->gid = make_kgid(current_user_ns(), result.uint_32); - if (!gid_valid(ctx->gid)) - goto bad_val; + ctx->gid = result.gid; return 0; case Opt_mode: