From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from va-1-111.ptr.blmpb.com (va-1-111.ptr.blmpb.com [209.127.230.111]) (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 D181727FB37 for ; Mon, 19 Oct 2026 06:37:52 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.127.230.111 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1792391874; cv=none; b=H7cVBmrIozegIPkJdoBlTu6799aim2riD/faTxnGWvukoUr7H7+CJaaZ/8wDIYxVeXUjEzWcTo3EF2h25H2LWJvam/jMGtVlf0i6uiv1GijhJsg/KS/M6sOh4dcEJSHYzwA17HAMxOjPUE2hNASIH4oacdGQZ05rrNtGoc2uo9g= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1792391874; c=relaxed/simple; bh=caWB8CfOrtFmFyXj4TTWB1Rz/T8Sw15yFpB9WJLKWdY=; h=Message-Id:Date:Content-Type:Cc:From:Subject:Mime-Version:To: In-Reply-To:References; b=tL4OOncAoyKpNryUtpN2xAO8qOFVViFJ8l2lVAD3/lSjFjXw1cuf1pzHoQfzk/KfPR+2L0qjSjgkIVw8Yi5nHT13h+Y7yerafU+N/ml1siHRM3vrW1FF8PRDVV3liV0/A0pZhCkG10PddXVVXRsAHCWvCbiSdmrnjAp+YUy7Gl8= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=bytedance.com; spf=pass smtp.mailfrom=bytedance.com; dkim=pass (2048-bit key) header.d=bytedance.com header.i=@bytedance.com header.b=PE2TgwBo; arc=none smtp.client-ip=209.127.230.111 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=bytedance.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=bytedance.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=bytedance.com header.i=@bytedance.com header.b="PE2TgwBo" DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; s=2212171451; d=bytedance.com; t=1792391861; h=from:subject: mime-version:from:date:message-id:subject:to:cc:reply-to:content-type: mime-version:in-reply-to:message-id; bh=TjWCCJlRJ8H9EFdUHA2mcG+z0PHZmAjw/ePCZbxewok=; b=PE2TgwBoWhdxpzNORLX9uTgPXI00GwjLXAJ8uWagaZRqImGDuTK5cY5R22JTfFYeKG3USQ 6sLn1IgIE1gIYkbT/wIf2wUsDRAxRMhTSePt8JdEmlE4DzRykJ4clNLc/A16zFP3BUkd+L c6x7FB+l9mk58yDP5TFe5i2kLEAYiSSP45umekVhd4kJ5OnMrboDYB6fvwD//UpwjPqFlD 9wzBqW80dUL5m2sw5FdBxfHinXV40HvIMPf+mMMEo+F3nYhIhQs4nN2J7J2qA2HnqT3tAP 6VGFDOTWN0Y4iPdoUAGjL066JPjtK6kQPlFaN6u2sxV5uqJDkQJMd0xszdmkfw== Message-Id: <13205cda-0ba8-4aca-b512-ce02526bcf07@bytedance.com> Content-Transfer-Encoding: 7bit Date: Mon, 19 Oct 2026 14:37:25 +0800 User-Agent: Mozilla Thunderbird Content-Type: text/plain; charset=UTF-8 X-Original-From: Zhao Gongyi Cc: , , , , , , From: "Zhao Gongyi" Subject: Re: [PATCH] vfs: keep the mount pinned while waiting for a parent delegation break Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: Mime-Version: 1.0 To: "Christian Brauner" , "Al Viro" In-Reply-To: <20261018-mehrpolig-goldschatz-medikament-3de24ee2cf35@brauner> X-Lms-Return-Path: References: <20261016093421.90725-1-zhaogongyi@bytedance.com> <20261016182927.GG989762@ZenIV> <20261016183845.GH989762@ZenIV> <20261018-mehrpolig-goldschatz-medikament-3de24ee2cf35@brauner> On 10/19/26 12:30 AM, Christian Brauner wrote: > On Fri, Oct 16, 2026 at 07:38:45PM +0100, Al Viro wrote: >>> So why not have it acquire an active superblock reference at the >>> same time? We don't need struct mount reference there - all it >>> takes in increment of inode->i_sb->s_active on try_break_deleg() >>> side and deactivate_super() on ->i_sb fetched *before* iput() >>> of ->di_inode on the break_deleg_wait() side... >>> >>> No need to mess with every user of that thing... > > Yeah, I like that a lot better than touching every caller. All the > break_deleg_wait() callers wait in plain process context with the locks > already dropped so deactivate_super() is fine there and the next caller > can't get it wrong. > > Please respin it that way. Mind the missing & on s_active in the sketch. > Hi Al and Christian, Thanks for the suggestion. I've respun the fix in the delegation helpers. try_break_deleg() now takes an active superblock reference when it retains the inode, and break_deleg_wait() drops it after iput(). The atomic_inc() call uses &inode->i_sb->s_active, as Christian noted. I built the updated code with KASAN enabled and reran all five reproducers on arm64 KVM. They completed without crashes or kernel warnings, and stack samples confirmed the delegation wait paths were exercised. I'll send v2 separately. Thanks, Gongyi