See the manpage addition for rationale
Details
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; | |
| 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 |
I now use this error code to fill errmsg at the call site.
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. | |
| 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. | |