> -----邮件原件----- > 发件人: Jeff Layton <jlayton@xxxxxxxxxx> > 发送时间: 2024年3月19日 21:09 > 收件人: Chen, Hanxiaochenhx.fnst@xxxxxxxxxxx>; Chuck Lever > <chuck.lever@xxxxxxxxxx>; Neil Brown <neilb@xxxxxxx>; Olga Kornievskaia > <kolga@xxxxxxxxxx>; Dai Ngo <Dai.Ngo@xxxxxxxxxx>; Tom Talpey > <tom@xxxxxxxxxx> > 抄送: linux-nfs@xxxxxxxxxxxxxxx > 主题: Re: [PATCH] NFSD: nfsctl: remove read permission of filehandle > > On Tue, 2024-03-19 at 18:47 +0800, Chen Hanxiao wrote: > > As write_filehandle can't accept zero-bytes writting, > > remove read permission of /proc/fs/nfsd/filehandle > > > > Signed-off-by: Chen Hanxiao <chenhx.fnst@xxxxxxxxxxx> ... > > > I don't think we can do this. mountd does this to get the rootfh for an > exported fs and it'll probably start failing if it can't open that file > for read: > > f = open("/proc/fs/nfsd/filehandle", O_RDWR); > > That write_filehandle interface sure is weird though. Could we get rid > of it by teaching cache_get_filehandle how to use name_to_handle_at > instead? That would be a lot cleaner and would get rid of yet another > dependency on /proc/fs/nfsd. name_to_handle_at return struct file_handle cache_get_filehandle return hexed struct knfsd_fh Could you please give some hints on how to convert from file_handle. f_handle to knfsd_fh.fh_raw? Regards, - Chen > -- > Jeff Layton <jlayton@xxxxxxxxxx>