Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

autofs: fix per-dentry timeout warning

The check that determines if the message that warns about the per-dentry
timeout being greater than the super block timeout is not correct.

The initial value for this field is -1 and the type of the field is
unsigned long.

I could change the type to long but the message is in the wrong place
too, it should come after the timeout setting. So leave everything else
as it is and move the message and check the timeout is actually set
as an additional condition on issuing the message. Also fix the timeout
comparison.

Signed-off-by: Ian Kent <raven@themaw.net>
Link: https://patch.msgid.link/20251111060439.19593-2-raven@themaw.net
Signed-off-by: Christian Brauner <brauner@kernel.org>

authored by

Ian Kent and committed by
Christian Brauner
b6cb3cce aa8aba61

+12 -10
+12 -10
fs/autofs/dev-ioctl.c
··· 432 432 if (!autofs_type_indirect(sbi->type)) 433 433 return -EINVAL; 434 434 435 - /* An expire timeout greater than the superblock timeout 436 - * could be a problem at shutdown but the super block 437 - * timeout itself can change so all we can really do is 438 - * warn the user. 439 - */ 440 - if (timeout >= sbi->exp_timeout) 441 - pr_warn("per-mount expire timeout is greater than " 442 - "the parent autofs mount timeout which could " 443 - "prevent shutdown\n"); 444 - 445 435 dentry = try_lookup_noperm(&QSTR_LEN(param->path, path_len), 446 436 base); 447 437 if (IS_ERR_OR_NULL(dentry)) ··· 460 470 ino->flags |= AUTOFS_INF_EXPIRE_SET; 461 471 ino->exp_timeout = timeout * HZ; 462 472 } 473 + 474 + /* An expire timeout greater than the superblock timeout 475 + * could be a problem at shutdown but the super block 476 + * timeout itself can change so all we can really do is 477 + * warn the user. 478 + */ 479 + if (ino->flags & AUTOFS_INF_EXPIRE_SET && 480 + ino->exp_timeout > sbi->exp_timeout) 481 + pr_warn("per-mount expire timeout is greater than " 482 + "the parent autofs mount timeout which could " 483 + "prevent shutdown\n"); 484 + 463 485 dput(dentry); 464 486 } 465 487