Re: [PATCH] 9p: fix WARN_ON when dropping nlink on files with nlink=0

Dominique Martinet <[email protected]> Tue, 21 Apr 2026 00:59:51 +0900
Newsgroups dev.linux.lists.v9fs,org.kernel.vger.linux-kernel,org.kernel.vger.stable
Message-ID <[email protected]>
Breno Leitao wrote on Mon, Apr 20, 2026 at 07:31:14AM -0700:
>     In cacheless mode the server is authoritative and the inode is on its
>     way out, so locally adjusting nlink buys nothing. Skip v9fs_dec_count()
>     entirely when neither CACHE_META nor CACHE_LOOSE is set, which both
>     avoids the warning and removes a class of nlink races (two concurrent
>     unlinkers observing nlink > 0 and both calling drop_nlink()) that an
>     nlink == 0 guard alone would only narrow rather than close.

I need to check this doesn't actually leak memory or something but this
sounds better to me, thanks.

Please send as a proper PATCH mail and I'll tentatively apply for 7.2
(a bit too late for 7.1)

-- 
Dominique Martinet | Asmadeus