HomeFreeBSD

ffs_mount(): return early if namei() fails to lookup disk device

Description

ffs_mount(): return early if namei() fails to lookup disk device

With soft updates enabled, an INVARIANTS panic is hit in ffs_unmount().

The problem occurs in ffs_mount() when upgrading a mount from ro->rw.
During a mount update, the soft update code gets set up but doesn't get
cleaned up if namei() fails when looking up the disk device.

Avoid this scenario by looking up the disk device first and bail early
if the namei() lookup fails.

PR: 256511
Reviewed by: mckusick, kib
Differential Revision: https://reviews.freebsd.org/D30870

(cherry picked from commit 0455cc7104ec8e8dd54b3f44049112a5a8ca329c)

Details

Provenance
rewAuthored on Mar 7 2022, 7:18 PM
Reviewer
mckusick
Differential Revision
D30870: ffs: skip upgrade from ro->rw if namei fails
Parents
rGc8f0a1c6d756: sh: fix autocompletion for commands that share name with a directory
Branches
Unknown
Tags
Unknown