From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 6F59937FF5F for ; Mon, 25 May 2026 17:07:42 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=170.10.129.124 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1779728863; cv=none; b=Nlsl/0UYSN/gldkwZJpVSU53urnsxT2IfqC7OEuvy30Rq3e53Btiqh37pcDawE+GWl1Bw3Xx0VsELusmGkreP4nY89U92s6WCkJeAjg09HFW1yXFcMUvVTnN7tWCKoP6dQzVEuR1ZSu0LN5Rl+AWtp+5JDfixtpMnA+U7FyZDEw= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1779728863; c=relaxed/simple; bh=EGS2JGmyeWkbOCbREIX2qtEvE51ujoNsVgCL48xBWXI=; h=Message-ID:Subject:From:To:Cc:Date:In-Reply-To:References: Content-Type:MIME-Version; b=RXgffAeDHx5TVfIbyZNP3wu9RNZGuKBgtHldZMkk7Euigsku8MZCsjvJJfZg2NqHDZiEJLR07BmumEg0izE9/eMyKh2yPowzVLhWn4hu5u6IB3lqdED2YYqeOvUMpRnofik9J9I7ZHTOuFKvkLATIQMYB5/aB2Ql6aKKyEYdojQ= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=redhat.com; spf=pass smtp.mailfrom=redhat.com; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b=dhioHvSU; dkim=pass (2048-bit key) header.d=redhat.com header.i=@redhat.com header.b=B4IY6GkQ; arc=none smtp.client-ip=170.10.129.124 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=redhat.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=redhat.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="dhioHvSU"; dkim=pass (2048-bit key) header.d=redhat.com header.i=@redhat.com header.b="B4IY6GkQ" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1779728861; 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=QQ8f0KL2cvJbeqS1wq3el83kZ9Z8vH79ZAL6r1+vgks=; b=dhioHvSUW0LXwpL2ye6gY9aEtrH575Eode9Y3bZkyFDeYpbbTkYBTB9MM0JZkKtl1AeGiF GoG47VJHDsbLzrDndbsVcyDWtVD5D/9ES7k8HW9uIoQQ0Csb5CtsMlQ7xRiKMN1+vUvum+ IwbtAkSnwz5Aia90ZNw4ZnOg9+/OCig= Received: from mail-yw1-f199.google.com (mail-yw1-f199.google.com [209.85.128.199]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-67-anKW7e32PHO2TJJk-sPZJA-1; Mon, 25 May 2026 13:07:40 -0400 X-MC-Unique: anKW7e32PHO2TJJk-sPZJA-1 X-Mimecast-MFC-AGG-ID: anKW7e32PHO2TJJk-sPZJA_1779728859 Received: by mail-yw1-f199.google.com with SMTP id 00721157ae682-7d296b0a093so56217567b3.3 for ; Mon, 25 May 2026 10:07:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=google; t=1779728859; x=1780333659; darn=vger.kernel.org; h=mime-version:user-agent:content-transfer-encoding:references :in-reply-to:date:cc:to:from:subject:message-id:from:to:cc:subject :date:message-id:reply-to; bh=QQ8f0KL2cvJbeqS1wq3el83kZ9Z8vH79ZAL6r1+vgks=; b=B4IY6GkQoeA6mxx8zFvjIHv1rw5Br7ObA6BH4M64VQ4WU6Hqk1GAUiuxBN81Ysi8fR ZwDRoKuZnH2y3aD88NE7jRHEBpMqrXc8vy5r5h3UTA+HgtWjx4fq5ehhF5VbbP+7movw CLTuGQqyAkdTSdUBZyjv7Emf0tHIBhS00MOl7s7WeYGyoWn2jsXYdpP66s0MrFJJG4ea 3IivF1Xp8tUen58bukrpcQRp3jpeOEkaWT7Hw7p7lyR6GpmYkqVAJNcuLG/MJacz00Y6 tRDq2BUx5w3dsFFV76OzIuQ2jHxDC7lL0r/GBonXJnS4WDQun1sK6026uV0PscSu56e+ ohsQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1779728859; x=1780333659; h=mime-version:user-agent:content-transfer-encoding:references :in-reply-to:date:cc:to:from:subject:message-id:x-gm-gg :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=QQ8f0KL2cvJbeqS1wq3el83kZ9Z8vH79ZAL6r1+vgks=; b=kRgPmvEe3UYN0/+Z2OdF7XSvyi/CV5hANEgRTOFNolmm16bga9HPzw42uqePLUWdc+ Um931QP4YMi4nh60uM7z5suN1DaqDpoz+WDZmSDo48ymuM/9WiVvhbkVXnXB+5o/2pgS WlSVrwKMyclMEFkQR76mvtV5BD44hOHDiIW4ytb9LD21qMMa2oxp7+eqnkk8wvi1E4nQ DC7LC1uioELGPnoTWsMMLE9X6a8EE0zYWPDpbDLCjYzDBeDvPAmdRfQ9CriOQAnvds+J otjKKmr65ftP1JaSb5OFyQxY9sE0R3pbUq/b2cYUBTX1cGju0PT8T0Nv4MUCFpINa8R+ l3Eg== X-Gm-Message-State: AOJu0YzUtV0m0tsKXLUtin3fhqZEMHyniycx32Xf0UY+TO8+wGboJVin c9X3QFKGlYuQynXIdn3s2tp/mFLibKfYAIPBM3BGDq9eOcdlDU39iPZQVF2Dt24VYpipBhh2vrX eCoJQtY62WhNYL/4+3os+RoJNX4JqT8PPTnaXCeJedu7E9N5u9+W5nzE2MYCEk/jPOQ== X-Gm-Gg: Acq92OELJ11g6Ue8seBkhLvaduUEFgUh36trmMwW3D6aoZkpMAYeX784Z2Z6ggWtzWA AwR0qHoI/9TybJPDeTswsC5caKbNUJebC6paD+V4fTFDfEkW94VP3TT8SBONm/5gpMlAMojUttF 2y2c1SfI4+n2NMvaJ2hGkJrqJa9CdVmrT4yQqyYNFZG0IrT3zk827JLv+Bn3LYY1bSz/0qYUm3o SS80FZhGVEhhHWL7EPVXHXBVBReI2/TMj4N/M4i7JdKz1hHjFQFpK3bT6sK4sbe5XkfLQxCY+mj zABOnduHU1X5faEcw/C6jeYU/W6ckThiwmTpWLxKZGYpejVWviC+bVnmydsmO8lT0Gu6UHKfmH2 BQ0t/pj1Y9CnbdoDs6V/6fIUiLVjTq8JEDdvwAn3ZrMBzZ5abbcxx X-Received: by 2002:a05:690c:3708:b0:7bf:9648:8c5c with SMTP id 00721157ae682-7d3345da2e5mr155237777b3.18.1779728859436; Mon, 25 May 2026 10:07:39 -0700 (PDT) X-Received: by 2002:a05:690c:3708:b0:7bf:9648:8c5c with SMTP id 00721157ae682-7d3345da2e5mr155237227b3.18.1779728858828; Mon, 25 May 2026 10:07:38 -0700 (PDT) Received: from li-4c4c4544-0032-4210-804c-c3c04f423534.ibm.com ([2600:1700:6476:1430::29]) by smtp.gmail.com with ESMTPSA id 00721157ae682-7d389813ea8sm48480087b3.4.2026.05.25.10.07.35 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 25 May 2026 10:07:38 -0700 (PDT) Message-ID: <1bb537f6dc36b00788b613fb8f71579478418457.camel@redhat.com> Subject: Re: [PATCH 04/17] nilfs2: replace get_zeroed_page() with kzalloc() From: Viacheslav Dubeyko To: "Mike Rapoport (Microsoft)" , Jan Kara , Mark Fasheh , Joel Becker , Joseph Qi , Ryusuke Konishi , Viacheslav Dubeyko , Trond Myklebust , Anna Schumaker , Chuck Lever , Jeff Layton , NeilBrown , Olga Kornievskaia , Dai Ngo , Tom Talpey , Alexander Viro , Christian Brauner , Jan Kara , Dave Kleikamp , Theodore Ts'o , Miklos Szeredi , Andreas Hindborg , Breno Leitao , Kees Cook , "Tigran A. Aivazian" Cc: linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org, ocfs2-devel@lists.linux.dev, linux-nilfs@vger.kernel.org, linux-nfs@vger.kernel.org, jfs-discussion@lists.sourceforge.net, linux-ext4@vger.kernel.org, linux-mm@kvack.org Date: Mon, 25 May 2026 10:07:34 -0700 In-Reply-To: <20260523-b4-fs-v1-4-275e36a83f0e@kernel.org> References: <20260523-b4-fs-v1-0-275e36a83f0e@kernel.org> <20260523-b4-fs-v1-4-275e36a83f0e@kernel.org> Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable User-Agent: Evolution 3.60.0 (3.60.0-1.fc44app2) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 On Sat, 2026-05-23 at 20:54 +0300, Mike Rapoport (Microsoft) wrote: > nilfs_ioctl_wrap_copy() allocates a temporary buffer with > get_zeroed_page(). >=20 > kzalloc() is a better API for such use and it also provides better > scalability and more debugging possibilities. >=20 > Replace use of get_zeroed_page() with kzalloc(). >=20 > Signed-off-by: Mike Rapoport (Microsoft) > --- > fs/nilfs2/ioctl.c | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) >=20 > diff --git a/fs/nilfs2/ioctl.c b/fs/nilfs2/ioctl.c > index e0a606643e87..b73f2c5d10f0 100644 > --- a/fs/nilfs2/ioctl.c > +++ b/fs/nilfs2/ioctl.c > @@ -69,7 +69,7 @@ static int nilfs_ioctl_wrap_copy(struct the_nilfs *nilf= s, > if (argv->v_index > ~(__u64)0 - argv->v_nmembs) > return -EINVAL; > =20 > - buf =3D (void *)get_zeroed_page(GFP_NOFS); > + buf =3D kzalloc(PAGE_SIZE, GFP_NOFS); > if (unlikely(!buf)) > return -ENOMEM; > maxmembs =3D PAGE_SIZE / argv->v_size; > @@ -107,7 +107,7 @@ static int nilfs_ioctl_wrap_copy(struct the_nilfs *ni= lfs, > } > argv->v_nmembs =3D total; > =20 > - free_pages((unsigned long)buf, 0); > + kfree(buf); > return ret; > } > =20 Makes sense to me. Reviewed-by: Viacheslav Dubeyko Thanks, Slava.