Page MenuHomeFreeBSD

nmount: Introduce the "onto_fsid" option
Needs RevisionPublic

Authored by arrowd on Wed, Sep 23, 3:39 PM.
Tags
None
Referenced Files
F173172102: D59930.id187536.diff
Thu, Sep 24, 2:29 AM
F173167701: D59930.id187536.diff
Thu, Sep 24, 1:52 AM
F173162347: D59930.id187507.diff
Thu, Sep 24, 1:04 AM
F173158216: D59930.id187536.diff
Thu, Sep 24, 12:26 AM
F173149658: D59930.id187507.diff
Wed, Sep 23, 10:56 PM
F173148914: D59930.id187536.diff
Wed, Sep 23, 10:51 PM
F173147817: D59930.diff
Wed, Sep 23, 10:40 PM
F173137635: D59930.diff
Wed, Sep 23, 9:02 PM
Subscribers

Details

Summary

See the manpage addition for rationale

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Passed
Unit
No Test Coverage
Build Status
Buildable 77227
Build 74110: arc lint + arc unit

Event Timeline

lib/libsys/mount.2
109
sys/kern/vfs_mount.c
816

I suggest to follow the existing style and initialize new vars in the block below.

984

Why do you need to strdup() the value? If you convert it into the fsid_t there, instead of doing it later, it should be good enough.

1729
1730

But I do not see a need to check for mp == NULL first.

if (mp != vp->v_mount) {
        error = ENOENT; /* Might be set the error string ? */
        vput(vp);
        vrele(nd.ni_dvp); /* Because of WANTPARENT */
}
 if (mp != NULL)
           vfs_rel(mp);
if (error != 0)
       goto out;
arrowd marked 2 inline comments as done.
  • Address comments
sys/kern/vfs_mount.c
984

strndup makes sure the value is NULL-terminated. vfs_buildopts makes sure that opt names are NULL-terminated, but copies values verbatim, as far as I understand.

There is no "snscanf" to pass the buffer length to it, so I'm using strndup to create a buffer that is 100% safe to pass to sscanf. Or am I being overly cautious here?

1730

error = ENOENT; /* Might be set the error string ? */

I now use this error code to fill errmsg at the call site.

vrele(nd.ni_dvp); /* Because of WANTPARENT */

vrele is already called in the "out" path.

lib/libsys/mount.2
111

I do not quite understand this sentence. Do you mean that there exists such requirement already (I do not think so)? Or do you mean that the patch introduces this requirement (again, seems to be not)?

sys/kern/vfs_mount.c
1038

ENOENT can be reported from vfs_domount() for other reasons, most likely due to non-existent fspath.

ziaee added inline comments.
lib/libsys/mount.2
94–96

This is an inappropriate use of column. Column requires a second width specifier for the second column. What you want for this usage is tag. This will render exactly the same as what you have now on terminal, except it won't be broken in the many other output formats. Also, the linter should complain.

I know, line 86 is broken too and this syntax was just copied from that, but we should not add a second fire.

ziaee requested changes to this revision.Wed, Sep 23, 9:12 PM
This revision now requires changes to proceed.Wed, Sep 23, 9:12 PM