[Ocfs2-devel] dinode link count inconsistency in ocfs2_read_links_count() logic

Alexey Asemov (Alex/AT) alex at alex-at.net
Sun Nov 27 08:00:26 UTC 2022


I've sent a formal patch, it is awaiting moderation according to the reply.

For how it happens: yes, ocfs2_link_max() returns OCFS2_DX_LINK_MAX 
indeed. And so large number of links is allowed.
But ocfs2_read_links_count() checks for dynamic di->i_dyn_features flag 
OCFS2_INDEXED_DIR_FL which is only valid and set for directories, not files.
So when reading file dinode, it drops the high part, and that is 
obviously wrong. Anyways, dropping high part seems terribly wrong to me.

KR,
Alex

On 25.11.2022 14:25, Joseph Qi wrote:
> Hi,
>
> Checked the code again, since feature indexed dirs is now default on, so
> the ocfs2_link_max() check will return OCFS2_DX_LINK_MAX, which can use
> high 16 bits of links count.
>
> Could you please send a formal patch?
>
> Thanks,
> Joseph
>



More information about the Ocfs2-devel mailing list