NFSv4.1 fs_locations compound request fileid
Subsystems (2)
PATCH 1/1 NFSv4.1 fs_locations compound request fileid
From: Andy Adamson <[email protected]>
Commit 28331a46d88459788c8fca72dbb0415cd7f514c9 "Ensure we request the ordinary fileid when doing readdirplus"
changed the meaning of NFS_ATTR_FATTR_FILEID which used to be set when FATTR4_WORD1_MOUNTED_ON_FILED was requested. Request FATTR4_WORD0_FILEID in the nfs4_proc_fs_locations GETATTR so that nfs_fhget succeeds and the referral is mounted.
--- fs/nfs/nfs4proc.c | 3 ++- 1 files changed, 2 insertions(+), 1 deletions(-)
fs/nfs/nfs4proc.c +2 -1
@@ -4685,7 +4685,8 @@ int nfs4_proc_fs_locations(struct inode *dir, const struct qstr *name, {struct nfs_server *server =NFS_SERVER (dir);u32 bitmask[2 ] = { - [0 ] =FATTR4_WORD0_FSID |FATTR4_WORD0_FS_LOCATIONS , + [0 ] =FATTR4_WORD0_FSID |FATTR4_WORD0_FS_LOCATIONS | +FATTR4_WORD0_FILEID , [1 ] =FATTR4_WORD1_MOUNTED_ON_FILEID , };struct nfs4_fs_locations_arg args = {
Signature · 1 line
1.7.3.1
Quoted 19 lines · On Thu, 2011-06-02 at 11:17 -0400, [email protected] wrote:
From: Andy Adamson <[email protected]>
Commit
28331a46d88459788c8fca72dbb0415cd7f514c9"Ensure we request the ordinary fileid when doing readdirplus"
changed the meaning ofNFS_ATTR_FATTR_FILEIDwhich used to be set whenFATTR4_WORD1_MOUNTED_ON_FILEDwas requested. RequestFATTR4_WORD0_FILEIDin thenfs4_proc_fs_locationsGETATTR so thatnfs_fhgetsucceeds and the referral is mounted.Signed-off-by Andy Adamson <[email protected]>--- fs/nfs/nfs4proc.c | 3 ++- 1 files changed, 2 insertions(+), 1 deletions(-)fs/nfs/nfs4proc.c +0
-0
fs/nfs/nfs4proc.c int nfs4_proc_fs_locations(struct inode *dir, const struct qstr *name, · line 4692
Quoted 9 lines
fs/nfs/nfs4proc.c +2
-1@@ -4685,7 +4685,8 @@ int nfs4_proc_fs_locations(struct inode *dir, const struct qstr *name, {struct nfs_server *server =NFS_SERVER (dir);u32 bitmask[2 ] = { - [0 ] =FATTR4_WORD0_FSID |FATTR4_WORD0_FS_LOCATIONS , + [0 ] =FATTR4_WORD0_FSID |FATTR4_WORD0_FS_LOCATIONS | +FATTR4_WORD0_FILEID , [1 ] =FATTR4_WORD1_MOUNTED_ON_FILEID , };struct nfs4_fs_locations_arg args = {
Nope. We can't do this...
The ordinary fileid is _not_ supposed to be supported for an absent filesystem. See RFC3530bis, section 7.3.1.
The correct thing to do here is rather to allow the nfs_fhget() to succeed with only a mounted_on_fileid if (and only if!) NFS_ATTR_FATTR_MOUNTPOINT or NFS_ATTR_FATTR_V4_REFERRAL are set.
Cheers
Trond
Signature · 6 lines
Trond Myklebust Linux NFS client maintainer NetApp [email protected] www.netapp.com
Quoted 32 lines · Trond Myklebust
Quoted 19 lines · On Thu, 2011-06-02 at 11:17 -0400, [email protected] wrote:
From: Andy Adamson <[email protected]>
Commit
28331a46d88459788c8fca72dbb0415cd7f514c9"Ensure we request the ordinary fileid when doing readdirplus"
changed the meaning ofNFS_ATTR_FATTR_FILEIDwhich used to be set whenFATTR4_WORD1_MOUNTED_ON_FILEDwas requested. RequestFATTR4_WORD0_FILEIDin thenfs4_proc_fs_locationsGETATTR so thatnfs_fhgetsucceeds and the referral is mounted.Signed-off-by Andy Adamson <[email protected]>---
fs/nfs/nfs4proc.c| 3 ++-1 files changed, 2 insertions(+), 1 deletions(-)fs/nfs/nfs4proc.c +0
-0fs/nfs/nfs4proc.c int nfs4_proc_fs_locations(struct inode *dir, const struct qstr *name, · line 4692
Quoted 9 lines
fs/nfs/nfs4proc.c +2
-1@@ -4685,7 +4685,8 @@ int nfs4_proc_fs_locations(struct inode *dir, const struct qstr *name, {struct nfs_server *server =NFS_SERVER (dir);u32 bitmask[2 ] = { - [0 ] =FATTR4_WORD0_FSID |FATTR4_WORD0_FS_LOCATIONS , + [0 ] =FATTR4_WORD0_FSID |FATTR4_WORD0_FS_LOCATIONS | +FATTR4_WORD0_FILEID , [1 ] =FATTR4_WORD1_MOUNTED_ON_FILEID , };struct nfs4_fs_locations_arg args = {Nope. We can't do this...
Quoted 6 lines
The ordinary fileid is _not_ supposed to be supported for an absent filesystem. See RFC3530bis, section 7.3.1.
The correct thing to do here is rather to allow the
nfs_fhget()to succeed with only amounted_on_fileidif (and only if!)NFS_ATTR_FATTR_MOUNTPOINTorNFS_ATTR_FATTR_V4_REFERRALare set.
Ahh. OK - WIll do.
-->Andy
Quoted 12 lines
Cheers
TrondSignature · 6 lines
Trond Myklebust Linux NFS client maintainer NetApp [email protected] www.netapp.com