Skip to content

ufs: Defensively handle NULL return from ufs_get_locked_folio()#1430

Open
vfsci-bot[bot] wants to merge 1 commit into
vfs.base.cifrom
pw/1097181/vfs.base.ci
Open

ufs: Defensively handle NULL return from ufs_get_locked_folio()#1430
vfsci-bot[bot] wants to merge 1 commit into
vfs.base.cifrom
pw/1097181/vfs.base.ci

Conversation

@vfsci-bot
Copy link
Copy Markdown

@vfsci-bot vfsci-bot Bot commented May 19, 2026

Series: https://patchwork.kernel.org/project/linux-fsdevel/list/?series=1097181
Submitter: Ingyu Jang
Version: 2
Patches: 1/1
Message-ID: <20260519085138.55591-1-ingyujang25@korea.ac.kr>
Base: vfs.base.ci
Lore: https://lore.kernel.org/linux-fsdevel/20260519085138.55591-1-ingyujang25@korea.ac.kr


Automated by ml2pr

ufs_get_locked_folio() may return either an error pointer (when
read_mapping_folio() fails) or NULL (when a concurrent truncate has
detached the folio from its mapping). In ufs_alloc_lastblock() the
NULL path cannot be reached in practice because the only caller,
ufs_truncate(), holds i_rwsem and so serialises against other
truncates. Still, the current IS_ERR()-only check does not match the
documented contract of ufs_get_locked_folio() and is fragile against
future callers.

Use IS_ERR_OR_NULL() to match the helper's return contract.

Signed-off-by: Ingyu Jang <ingyujang25@korea.ac.kr>
Reviewed-by: Jan Kara <jack@suse.cz>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant