Noticed by: Shawn Webb
I think that kib@ wanted something more like this when things were locked. They are no longer locked, but I think this is the right thing to do...
Differential D26122
don't send the message if there was an issue in constructing it. Also allocate the fixed buffer with M_NOWAIT. It was overlooked in the various code movements during review. imp on Aug 19 2020, 5:50 PM. Authored by Tags None Referenced Files
Subscribers
Details
Noticed by: Shawn Webb I think that kib@ wanted something more like this when things were locked. They are no longer locked, but I think this is the right thing to do...
Diff Detail
Event TimelineComment Actions This makes the mechanism even less useful. I made an (ignored) note in the previous review that unmount options can be changed by unmount, so they are not that interesting. Options for mounted filesystem can be obtained from the fs itself using statfs(2) or like. It is more important for consumer to be notified that a mount was created or destroyed, than to provide a lot of secondary data. I would suggest to send some simpler message if large buffer cannot be allocated, e.g. fall back to small alloca(). Comment Actions Yea, good point...
Yea, I included it to communicate forced vs non forced. Perhaps we should do that in other ways? Now I understand it better, I'm back with you...
That's an interesting approach... I'll noodle through that and post a new version.... ah, the only question I have is how big is too big? If we can do 1k on the stack, maybe we should just do that all the time... if not, what's a good limit? Comment Actions We can probe remaining stack with GET_STACK_USAGE()... I don't know if/how much we need to leave for interrupts, and we need to leave a few bytes for whatever devctl_notify() does, but that at least gives us a heuristic for "is a large stack buffer reasonable?" Comment Actions But forced unmount is passed as MNTK_UNMOUNTF, it is in mnt_kern_flags. MNT_FORCE is for forced rw mounts of dirty fs, and for forced remounts rw->ro. Yes, it very confusing.
Assume that you have 256 bytes, this is sane value for all arches and in fact should be enough to pass fsid. 1k is not reasonable IMO. Comment Actions The real answer is to pre-allocate. I have a better patch that does that in the works I'll post in a bit. |