[Bug 224037] Kernel crashes when trying to mount certain USB keys reported as WriteProtected

bugzilla-noreply at freebsd.org bugzilla-noreply at freebsd.org
Sun Dec 3 17:33:53 UTC 2017


https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=224037

--- Comment #18 from Conrad Meyer <cem at freebsd.org> ---
(In reply to Andriy Gapon from comment #17)
> I think that we need to fix a bug that leads to the geom_vfs / buffer-cache
> crash in any case.

Agreed.  That's my focus with this chain of duplicated bugs.

> It might be also nice to add the r/o mount fallback mechanism.

Yes, although that is an orthogonal enhancement, IMO, and met some resistance
in the earlier attempt.  If mount fails with EROFS or EACCES or whatever and
dmesg contains the same CAM errors they do now, I think sysamdmins will figure
it out.

> But on top of those things we could modify g_disk_access() to prevent the write
> access altogether if a disk is in the write-protected mode.

Yeah, that makes sense too.  It would reduce the complexity required in higher
level layers.  Instead of having to wait for the first IO to fail (probably
whatever sets the dirty flag on a superblock), filesystems that rely on the
underlying device to be a GEOM object (e.g., msdosfs) will encounter an error
trying to g_access() (via g_vfs_open(..., 1)) the underlying disk writable.

That would also solve the initial bug without having to change the filesystem
level at all.

-- 
You are receiving this mail because:
You are the assignee for the bug.


More information about the freebsd-scsi mailing list