From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-pl1-f173.google.com (mail-pl1-f173.google.com [209.85.214.173]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id A4BF620E319 for ; Fri, 10 Jan 2025 16:42:54 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.214.173 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1736527376; cv=none; b=dkJtcBXV0mkmJeI/8B0Zw02tVYqw0X2Z3AoXBv0x7mXX68roe0b5Vdba9NbrpyxFXXwvOk9o4swpwmtNfalniCkuTn05QhnZUJT1IR2u/VUUo4X6rYPCFvYQ1tD05RBE+AkhgBxVnQN9jo+88U/en+CKh+5TNyln3QG1n9HxNhA= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1736527376; c=relaxed/simple; bh=hSF878rRLVN3V7q+23zKpkuvOPJSB5IeErule9b2a7Q=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=o9ZBcSBdVrLf6sb2/37ESu/wEAMAj4JBunq5f7uoyI+fNg1D+8efpwvZVpPDVCmaoQM2QY0YHdgCt9wuWq6zbLDQyLMX6DffaXGBa5tdWxMbLuKzD8M2Rzbul5QM4Q64kMhV1ll1bLPSjBMk8y7OhYtwSXV7790jtKMOEWjdfLs= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com; spf=pass smtp.mailfrom=google.com; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b=i717Nw/Y; arc=none smtp.client-ip=209.85.214.173 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=google.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="i717Nw/Y" Received: by mail-pl1-f173.google.com with SMTP id d9443c01a7336-2163affd184so126065ad.1 for ; Fri, 10 Jan 2025 08:42:54 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1736527374; x=1737132174; darn=vger.kernel.org; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=8B9UEM3Amqhe8i/EQ+pCj0mhLJDNX+jIbcuBZxmyH8k=; b=i717Nw/YElZYQgQjXHZqOr67INM6JwIHvqdNFaPEDe6ny7/ie2YCuz0YI6fd5Wq8z0 jLEDpJSpMjSx+vihcCjwVubEsDpIwc84yfdm8Aq8WMAaxcw4JaDi0A1YXYwm02iO1/+s t3zWs46qFwVc/rdUfd0P8LcktEkFrsPyMo5irRpfB1NNxwZiRVAe39fDFtDgBti6CbuY BiAfXK5M8hkcuTY8E7sx3YGQm5QZzc3AO/esuDnVRCZeF8DZ+jHn4P4kZSjGDBiXijUD jWykEqSrUBEo20ChAEdlix2pbx9aw0n+aHYK+g6S8ZpPZ0uVqFsIOuUpxi2BMlmzIRJh CgKQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1736527374; x=1737132174; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=8B9UEM3Amqhe8i/EQ+pCj0mhLJDNX+jIbcuBZxmyH8k=; b=vvwMYg47xttzjtMLSvEdKvvHdRFS1nleQ9R80Pbn2d4n42BryVCNTNaE06UgIX6DK+ p+zk1cwpraqjMn1ca2NX5PcKxJ78Hjx+lvKGpSf82tIKZQcrtua7jWjiA7bMW21MxD3d Pf6BVpFSfn6fmn87h6Ic21Mj63xp9ZNsrCuZ/nFUyUsxvyIOaLCG+3eqzOJzBdcvP3J3 9OgBMBsduyVGc3DcwV2+tESPp+tKyrA4jkm57uxxQW1oWZC46YgsE1jKTfbsmdUTecNx 2IkAvjkpW174QEcuvJir8wJqEuTrGbBYzbcBh1xccPjy55mPIjC3wnmFYZHgzzRNeCYK g3hA== X-Forwarded-Encrypted: i=1; AJvYcCXRPAFd37Un6hg/rBmXAJCziFkJE2o72nU8njy5ONJ0+3n6SQ4aDcV1TuH1G+jRECalDi8TMmbQObzl/LM=@vger.kernel.org X-Gm-Message-State: AOJu0YzGb9aPbIFL91cPQhCv3+nkYQ8Bx/fb41krdPa1EtO523D3jZlK 0NUVhR6tqk55i1oWLcVhO5ckmELap3xc3HyyjLPTHVhjjO+nbY5Ixw2kWUgaeQ== X-Gm-Gg: ASbGncuSuW0tkvpzCRggcXhQFnZQbeZuV/KpvaemuI0JH8Z//0osx/XGFnqpRsO2pck Yk8f3jvlRCf7UOHwqBsyQcpwLx02HAIz6U7Clfzv5xHub0SQf4J2o0BWb3duKWfp2PDWp/3a9va FuPS057unloylxY4JscQM3jA2Op1Z/oksR7h5P/B4aih+03M2kBBVMMbQTJTpXRshZJy9eVtJQL UKH8efvcnkc6OWdbZ9x2A2uGEX/OGSidjEkye7S60T0QkQnsbRSs/Ae6w== X-Google-Smtp-Source: AGHT+IElpsrYihhFYviENoY8X80XRkHv+RxF4IdnwvSfZybXx4mdHJqjSDS5ZB5vhbkvbrYg0AMpFQ== X-Received: by 2002:a17:903:31d8:b0:216:6dab:8042 with SMTP id d9443c01a7336-21aa07f34a2mr2672725ad.12.1736527373861; Fri, 10 Jan 2025 08:42:53 -0800 (PST) Received: from google.com ([2620:15c:2d:3:99d3:ef93:6e2e:8b59]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-72d4056d477sm1719467b3a.42.2025.01.10.08.42.53 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 10 Jan 2025 08:42:53 -0800 (PST) Date: Fri, 10 Jan 2025 08:42:49 -0800 From: Isaac Manjarres To: Lorenzo Stoakes Cc: Andrew Morton , kaleshsingh@google.com, jstultz@google.com, aliceryhl@google.com, surenb@google.com, kernel-team@android.com, linux-mm@kvack.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v3 1/2] mm/memfd: Refactor and cleanup the logic in memfd_create() Message-ID: References: <20250109185908.1006310-1-isaacmanjarres@google.com> <20250109185908.1006310-2-isaacmanjarres@google.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: On Fri, Jan 10, 2025 at 12:47:42PM +0000, Lorenzo Stoakes wrote: > On Thu, Jan 09, 2025 at 10:59:04AM -0800, Isaac J. Manjarres wrote: > > memfd_create() is a pretty busy function that could be easier to read > > if some of the logic was split out into helper functions. > > > > Therefore, split the flags sanitization, name allocation, and file > > structure allocation into their own helper functions. > > > > No functional change. > > > > Signed-off-by: Isaac J. Manjarres > > Great this looks good now, thanks! > > Reviewed-by: Lorenzo Stoakes > > I agree with Alice that the comment re: kfree() is superfluous, not > critical, but if you want to do a v4 feel free to migrate tags to that. > Thanks! Yes, I'll go ahead and do that. --Isaac