Page MenuHomeFreeBSD

Add option to disable inital userland sync to reboot(8)
ClosedPublic

Authored by smh on Dec 8 2015, 11:22 PM.
Tags
None
Referenced Files
Unknown Object (File)
Mon, Nov 18, 6:39 AM
Unknown Object (File)
Tue, Oct 22, 1:51 AM
Unknown Object (File)
Oct 18 2024, 9:36 PM
Unknown Object (File)
Oct 18 2024, 9:02 AM
Unknown Object (File)
Oct 18 2024, 8:00 AM
Unknown Object (File)
Oct 4 2024, 11:08 PM
Unknown Object (File)
Oct 4 2024, 1:45 AM
Unknown Object (File)
Oct 1 2024, 8:47 PM
Subscribers

Details

Summary

It can be useful to bypass the userland sync(2) during reboot(8) while still allow the kernel sync to occur.

An example of this is when rebooting with disconnected iSCSI sessions which would otherwise cause the reboot to hang on BIOs that will never complete.

Add the -N option to reboot etc that allows the userland syncs to be skipped but still process the kernel sync during the reboot(2) syscall.

Test Plan

This depends on https://reviews.freebsd.org/D4429
reboot(8) a system with oustanding BIOs due to disconnected iSCSI session backing a mounted FS on a debug kernel.

  1. Without any options the system will hang due to oustanding BIOs
  2. With -n either a panic or hang will occur.
  3. With -N a clean reboot will occur.

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
Lint Passed
Unit
No Test Coverage
Build Status
Buildable 1494
Build 1500: arc lint + arc unit

Event Timeline

smh retitled this revision from to Add option to disable inital userland sync to reboot(8).
smh updated this object.
smh edited the test plan for this revision. (Show Details)
bjk added inline comments.
sbin/reboot/reboot.8
102

I think I would hyphenate "best-effort" and possibly also put it within .Dq.

103

comma both before and after "e.g.".

Updated as per bjk's feedback.

smh marked 2 inline comments as done.Dec 9 2015, 6:40 PM
wblock added inline comments.
sbin/reboot/reboot.8
104

This sentence is long and has a couple of pauses. My person preference is to avoid Latin when possible. How about:

reboot when devices might be unavailable.
This can happen when devices have been disconnected, such as with
.Xr iscsi 4 .
smh edited edge metadata.

Use wblock's words.

smh marked an inline comment as done.Dec 10 2015, 9:13 PM

Hi guys is everyone happy with this current version now?

bjk added a reviewer: bjk.

Seems okay here.

Unless we want to add a note about -n and -N being mutually incompatible, but one would hope that the existing descriptions suffice to indicate that.

This revision is now accepted and ready to land.Dec 14 2015, 7:45 PM
smh edited edge metadata.

Added check for -N and -n to prevent confusion based on bjk's feedback.

This revision now requires review to proceed.Dec 14 2015, 8:34 PM

If you can confirm you're still ok with addition of the "-N cannot be used with -n" bjk, that would be appreciated

bjk edited edge metadata.

That looks fine, thanks.

This revision is now accepted and ready to land.Dec 14 2015, 10:19 PM
This revision was automatically updated to reflect the committed changes.
This revision is now accepted and ready to land.Dec 29 2015, 12:24 PM
head/sbin/reboot/reboot.c
79 ↗(On Diff #11308)

You need to also set Nflag = 0 here

This revision was automatically updated to reflect the committed changes.