mesos-reviews mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Gilbert Song <songzihao1...@gmail.com>
Subject Re: Review Request 55713: Added linux helper function fs::type() for filesystem id detection.
Date Fri, 20 Jan 2017 10:06:43 GMT


> On Jan. 19, 2017, 3:31 p.m., James Peach wrote:
> > src/linux/fs.hpp, line 161
> > <https://reviews.apache.org/r/55713/diff/1/?file=1608943#file1608943line161>
> >
> >     `fstype()` would be a bit more obvious to me, though this is consistent with
Mesos style.

Thought about this previously and prefer `type()`. Since with namespace defined, `fs::type()`
might be better than `fs::fsType()`.


> On Jan. 19, 2017, 3:31 p.m., James Peach wrote:
> > src/linux/fs.cpp, line 94
> > <https://reviews.apache.org/r/55713/diff/1/?file=1608944#file1608944line94>
> >
> >     In the past I've been told that the caller should add context to the error string,
in which case this should just return `ErrnoError()` and the caller should be responsible
for adding the path.

We still have some `ErrnoError()` with error strings. But yes, I agree that we should use
`ErrnoError()` only.


> On Jan. 19, 2017, 3:31 p.m., James Peach wrote:
> > src/linux/fs.cpp, line 96
> > <https://reviews.apache.org/r/55713/diff/1/?file=1608944#file1608944line96>
> >
> >     Why are you truncating the return value? `__fsword_t` can be 8 bytes. Maybe
it is worth defining a cleaner typedef for the fs type?
> >     
> >     ```
> >     typedef fstype_t __fsword_t;
> >     ```

Thought about whether or not to use `__fsword_t` as well. Let's keep this comment open.

I used `uint32_t` (4 bytes) because `__fsword_t` is not supposed to be public. Please see:
```
The __fsword_t type used for various fields in the statfs structure
       definition is a glibc internal type, not intended for public use.
       This leaves the programmer in a bit of a conundrum when trying to
       copy or compare these fields to local variables in a program.  Using
       unsigned int for such variables suffices on most systems.
```
from: http://man7.org/linux/man-pages/man2/fstatfs64.2.html

which means that using `uint32_t` or `unsigned int` should be fine for most systems.


- Gilbert


-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/55713/#review162359
-----------------------------------------------------------


On Jan. 19, 2017, 3:33 p.m., Gilbert Song wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/55713/
> -----------------------------------------------------------
> 
> (Updated Jan. 19, 2017, 3:33 p.m.)
> 
> 
> Review request for mesos, Avinash sridharan, Jie Yu, James Peach, Timothy Chen, and Jiang
Yan Xu.
> 
> 
> Bugs: MESOS-6958
>     https://issues.apache.org/jira/browse/MESOS-6958
> 
> 
> Repository: mesos
> 
> 
> Description
> -------
> 
> Get filesystem type id by using statfs() from <sys/vfs.h>.
> 
> 
> Diffs
> -----
> 
>   src/linux/fs.hpp da49c9ebfa938d169152ed3b6e4df7378711b013 
>   src/linux/fs.cpp 913e23317291db164fe6bdf77f3eca146dedec9b 
>   src/tests/containerizer/fs_tests.cpp ccdd5967d01abfe4fa7746e3588ff93c6e0fe7e4 
> 
> Diff: https://reviews.apache.org/r/55713/diff/
> 
> 
> Testing
> -------
> 
> make check
> 
> 
> Thanks,
> 
> Gilbert Song
> 
>


Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message