Re: [PATCH] gfs2: Move i_nlink checks from gfs2_{link,rename,mkdir} to VFS layer
From: Al Viro
Date: Fri Sep 26 2025 - 00:49:12 EST
On Fri, Sep 26, 2025 at 10:56:04AM +0800, Youling Tang wrote:
> From: Youling Tang <tangyouling@xxxxxxxxxx>
>
> vfs_{link, rename, mkdir} will check i_nlink. When sb->s_max_links is set,
> set sb->s_max_links in gfs2 to simplify the code.
For gfs2 you are going to run into a problem - link count is not stable until
you take gfs2 locks; checks in vfs_link() et.al. will be inevitably racy for
cluster filesystems.