[LTP] fsconfig04: Check FSCONFIG_SET_PATH

Wei Gao wegao@suse.com
Thu May 7 14:25:57 CEST 2026


On Thu, Apr 30, 2026 at 06:34:58AM +0000, linuxtestproject.agent@gmail.com wrote:
> Hi Wei,
> 
> On Thu, 30 Apr 2026 05:19:07 +0000, Wei Gao wrote:
> > fsconfig04: Check FSCONFIG_SET_PATH
> 
> > +	Fixes: https://github.com/linux-test-project/ltp/issues/1169
> 
> `Fixes:` must reference a git commit SHA. Use `Closes:` for GitHub issue URLs.
> 
> > +	TEST(fsconfig(fd, FSCONFIG_CMD_CREATE, NULL, NULL, 0));
> > +	if (TST_RET == -1)
> > +		tst_brk(TFAIL | TTERRNO, "fsconfig(FSCONFIG_CMD_CREATE) failed");
> 
> [...]
> 
> > +	snprintf(path, sizeof(path), "tune2fs -l %s 2>&1", dev0);
> > +	tune2fs = SAFE_POPEN(path, "r");
> > +
> > +	while (fgets(line, PATH_MAX, tune2fs)) {
> > +		if (*line && strstr(line, "Journal device:") && strstr(line, device_str)) {
> 
> `FSCONFIG_CMD_CREATE` instantiates the filesystem context in kernel memory but
> does not update the on-disk superblock. `tune2fs -l dev0` will still show dev1
> as the journal device (from the last mkfs), not dev2 — so `found` will always
> be 0 and the test always reports TFAIL. Either complete the mount with
> fsmount()/move_mount() and verify the active journal via runtime state, or
> confirm whether ext4's FSCONFIG_CMD_CREATE with journal_path actually persists
> the binding to the superblock (and document it if so).
Ran fsconfig04.c on a Linux 6.17 kernel. The test passed with TPASS: Device found in journal.

> 
> ---
> Note:
> 
> Our agent completed the review of the patch. The agent can sometimes produce
> false positives although often its findings are genuine. If you find issues with
> the review, please comment this email or ignore the suggestions.
> 
> Regards,
> LTP AI Reviewer


More information about the ltp mailing list