Re: [PATCH v2 1/2] hfs: Validate CNIDs in hfs_read_inode

Tetsuo Handa
2025-11-11T14:39:36Z

On 2025/11/04 10:47, George Anthony Vernon wrote:
> + if (!is_valid_cnid(inode->i_ino,
> + S_ISDIR(inode->i_mode) ? HFS_CDR_DIR : HFS_CDR_FIL))
> + BUG();

Is it guaranteed that hfs_write_inode() and make_bad_inode() never run in parallel?
If no, this check is racy because make_bad_inode() makes S_ISDIR(inode->i_mode) == false.