Re: [Review] Fixes to the VFS layer
Francois Tigeot wrote:
> Alex Hornung wrote:
>>
>> as I said previously on IRC I disagree with this approach to statfs and
>> hence to your first two patches. You should be using the statfs entry
>> point and not inspect the statfs structure in the mount point.
>>
>> For that, you need to simply fix the right thing, which would be the
>> VOP_STATFS entry of nullfs and make it populate the fields you need as
>> you expect.
>
> To be honest, I had forgotten about this conversation; I'll try to
> replace the direct struct mount accesses by the use of VOP_STATFS.
I'm focusing on the first patch for now, the one which initializes
mp->mnt_stat.f_mntonname from nullfs_mount()
>> That the stat field in the mount point is not populated as you would
>> like it is *not* a bug and doesn't really need fixing, you should be
>> using the right approach instead, one that is using the API instead of
>> raw accesses.
Guess where VOP_STATFS takes the values it returns ? From mp->mnt_stat :
http://opengrok.wolfpond.org/source/xref/sys/vfs/nullfs/null_vfsops.c#nullfs_statfs
nullfs_statfs is a very simple function; it only copies existing values.
The initial name of the mount point can only be known from the
nullfs_mount function; if this patch is not applied, VOP_STATFS will
never be able to return the correct values.
I'm afraid patch-0008 has to be applied.
--
Francois Tigeot
討論串 (同標題文章)
完整討論串 (本文為第 5 之 5 篇):