From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp-out1.suse.de (smtp-out1.suse.de [195.135.223.130]) (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 BACB6366560 for ; Wed, 13 May 2026 03:21:11 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=195.135.223.130 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1778642473; cv=none; b=mxdiOYJ/BjvACsyQRwlipGBx3lDKIwweuvsp7+bzrogeqyGoDYtp63XkO7EKBlMMn+BInlVO3THKs5Tz/xx1TngVPBFfFqnZxx9vOxoS57RG4U2jxTNr+Robktqkyabprjp4v6qKE2+nmafN2+6upcSjk62vehFh6Y5T8YwB4LA= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1778642473; c=relaxed/simple; bh=iseZaH8VTIwpphByCDBKwv97k2paJB99quSLHLLt5Q0=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=Q1yWwZiM5MdNgSjzdVpUmZsaJulcxj6+RXrUL1A+FedvMBBw/hUniqWLEu+avsZqeTqO76Tol9jMrQan19pkA1qK4wTQkarWwcZjXhMooTXaPda+Ub2USpo+lzWZtTKfpz5dl6p8oMmh1IxT2YIyLQNKnVUJO364XZgJR8ICvR4= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=suse.de; spf=pass smtp.mailfrom=suse.de; dkim=pass (1024-bit key) header.d=suse.de header.i=@suse.de header.b=IASRPJuG; dkim=permerror (0-bit key) header.d=suse.de header.i=@suse.de header.b=3SqJmSQf; dkim=pass (1024-bit key) header.d=suse.de header.i=@suse.de header.b=gzR57fTr; dkim=permerror (0-bit key) header.d=suse.de header.i=@suse.de header.b=XHY9HfyL; arc=none smtp.client-ip=195.135.223.130 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=suse.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=suse.de Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=suse.de header.i=@suse.de header.b="IASRPJuG"; dkim=permerror (0-bit key) header.d=suse.de header.i=@suse.de header.b="3SqJmSQf"; dkim=pass (1024-bit key) header.d=suse.de header.i=@suse.de header.b="gzR57fTr"; dkim=permerror (0-bit key) header.d=suse.de header.i=@suse.de header.b="XHY9HfyL" Received: from imap1.dmz-prg2.suse.org (unknown [10.150.64.97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by smtp-out1.suse.de (Postfix) with ESMTPS id 845805CC1D; Wed, 13 May 2026 03:21:08 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1778642469; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=A2uARObael505esap0DzuRVLIv8YNqaaPaxSLuracHo=; b=IASRPJuGm0PuJBAZ37H/s5Rv9TxceLAN3TLZKV2B7eotlOS5Rz98ngyfdBmxsACH+z/33x wR1vbGIGyMrTn0v2OWlLnphXPDjV35XIF8Rm7Exh8wc+QeP8Iefy5nnA9IMarEsI0lwPQl oBybGe1RPJMZyttwwwER/9IRcQGXXe0= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1778642469; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=A2uARObael505esap0DzuRVLIv8YNqaaPaxSLuracHo=; b=3SqJmSQfFzAZVinVKq0esByAZrSjY3MYfhj3vVDcNI3hBuUjuem1CZwbx5mXr7DH5xKmR2 jQ91ZTN/7k7UyUCg== Authentication-Results: smtp-out1.suse.de; none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1778642468; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=A2uARObael505esap0DzuRVLIv8YNqaaPaxSLuracHo=; b=gzR57fTrH1oo2SMUBFWIn9h6HwDhs/CmOhN6Z6RA5d9+rGRSMvylqL1+ctk+F7n543HUv5 p24GMWRhAsGtnp0DoPIKIG9VkkeYTsJ6N4765tb1XGRz2UkTbmNmy/jaPRGAta+5xBKRkG h7ymPoN1GxCf8u1rrhn6F7OMd/T5voQ= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1778642468; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=A2uARObael505esap0DzuRVLIv8YNqaaPaxSLuracHo=; b=XHY9HfyL/pZ8hAVeEE/YVS6aJKcpmxSVdOTC6bahZoQTHhWRcaR79jVkch1Y1V/bQQv7NM l0bI7Ssg/LI+UdAQ== Received: from imap1.dmz-prg2.suse.org (localhost [127.0.0.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by imap1.dmz-prg2.suse.org (Postfix) with ESMTPS id 28DDE593A9; Wed, 13 May 2026 03:21:08 +0000 (UTC) Received: from dovecot-director2.suse.de ([2a07:de40:b281:106:10:150:64:167]) by imap1.dmz-prg2.suse.org with ESMTPSA id vSDRByTuA2peAgAAD6G6ig (envelope-from ); Wed, 13 May 2026 03:21:08 +0000 Date: Wed, 13 May 2026 05:21:06 +0200 From: Oscar Salvador To: Lorenzo Stoakes Cc: Andrew Morton , Muchun Song , David Hildenbrand , Pedro Falcato , "Liam R . Howlett" , linux-mm@kvack.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] Revert "mm/hugetlbfs: update hugetlbfs to use mmap_prepare" Message-ID: References: <20260512160643.266960-1-ljs@kernel.org> 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: <20260512160643.266960-1-ljs@kernel.org> X-Spam-Level: X-Spamd-Result: default: False [-0.80 / 50.00]; SEM_URIBL(3.50)[xidian.edu.cn:email]; BAYES_HAM(-3.00)[100.00%]; NEURAL_HAM_LONG(-1.00)[-1.000]; NEURAL_HAM_SHORT(-0.20)[-1.000]; MIME_GOOD(-0.10)[text/plain]; ARC_NA(0.00)[]; MISSING_XM_UA(0.00)[]; RCVD_TLS_ALL(0.00)[]; TO_DN_SOME(0.00)[]; MIME_TRACE(0.00)[0:+]; RCVD_VIA_SMTP_AUTH(0.00)[]; RCPT_COUNT_SEVEN(0.00)[8]; DKIM_SIGNED(0.00)[suse.de:s=susede2_rsa,suse.de:s=susede2_ed25519]; FROM_HAS_DN(0.00)[]; FUZZY_RATELIMITED(0.00)[rspamd.com]; FROM_EQ_ENVFROM(0.00)[]; TO_MATCH_ENVRCPT_ALL(0.00)[]; RCVD_COUNT_TWO(0.00)[2]; DBL_BLOCKED_OPENRESOLVER(0.00)[imap1.dmz-prg2.suse.org:helo,suse.de:email,xidian.edu.cn:email,localhost.localdomain:mid] X-Spam-Flag: NO X-Spam-Score: -0.80 On Tue, May 12, 2026 at 05:06:43PM +0100, Lorenzo Stoakes wrote: > This reverts commit ea52cb24cd3f ("mm/hugetlbfs: update hugetlbfs to use > mmap_prepare") with conflict resolution to account for changes in commit > ea52cb24cd3f ("mm/hugetlbfs: update hugetlbfs to use mmap_prepare"). > > The patch incorrectly handled hugetlb VMA lock allocation at the > mmap_prepare stage, where a failed allocation occurring after mmap_prepare > is called might result in the lock leaking. > > There is no risk of a merge causing a similar issues, as VMA_DONTEXPAND_BIT > is set for hugetlb mappings. > > As a first step in addressing this issue, simply revert the change so we > can rework how we do this having corrected the underlying issues. > > We maintain the VMA flags changes as best we can, accounting for the fact > that we were working with a VMA descriptor previously and propagating > like-for-like changes for this. > > Note that we invoke vma_set_flags() and do not call vma_start_write() as > vm_flags_set() does. This is OK as it's being done in an .mmap hook where > the VMA is not yet linked into the tree so nobody else can be accessing it. > > Fixes: ea52cb24cd3f ("mm/hugetlbfs: update hugetlbfs to use mmap_prepare") > Reported-by: Mingyu Wang <25181214217@stu.xidian.edu.cn> > Closes: https://lore.kernel.org/linux-mm/20260425070700.562229-1-25181214217@stu.xidian.edu.cn/ > Cc: > Signed-off-by: Lorenzo Stoakes Acked-by: Oscar Salvador -- Oscar Salvador SUSE Labs