Skip to content

Commit 0770249

Browse files
neilbrownchucklever
authored andcommitted
nfsd: don't create nfsv4recoverydir in nfsdfs when not used.
When CONFIG_NFSD_LEGACY_CLIENT_TRACKING is not set, the virtual file /proc/fs/nfsd/nfsv4recoverydir is created but responds EINVAL to any access. This is not useful, is somewhat surprising, and it causes ltp to complain. The only known user of this file is in nfs-utils, which handles non-existence and read-failure equally well. So there is nothing to gain from leaving the file present but inaccessible. So this patch removes the file when its content is not available - i.e. when that config option is not selected. Also remove the #ifdef which hides some of the enum values when CONFIG_NFSD_V$ not selection. simple_fill_super() quietly ignores array entries that are not present, so having slots in the array that don't get used is perfectly acceptable. So there is no value in this #ifdef. Reported-by: Petr Vorel <pvorel@suse.cz> Reviewed-by: Jeff Layton <jlayton@kernel.org> Fixes: 74fd487 ("nfsd: new Kconfig option for legacy client tracking") Signed-off-by: NeilBrown <neilb@suse.de> Reviewed-by: Petr Vorel <pvorel@suse.cz> Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
1 parent d43113f commit 0770249

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

fs/nfsd/nfsctl.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,12 +48,10 @@ enum {
4848
NFSD_MaxBlkSize,
4949
NFSD_MaxConnections,
5050
NFSD_Filecache,
51-
#ifdef CONFIG_NFSD_V4
5251
NFSD_Leasetime,
5352
NFSD_Gracetime,
5453
NFSD_RecoveryDir,
5554
NFSD_V4EndGrace,
56-
#endif
5755
NFSD_MaxReserved
5856
};
5957

@@ -1360,7 +1358,9 @@ static int nfsd_fill_super(struct super_block *sb, struct fs_context *fc)
13601358
#ifdef CONFIG_NFSD_V4
13611359
[NFSD_Leasetime] = {"nfsv4leasetime", &transaction_ops, S_IWUSR|S_IRUSR},
13621360
[NFSD_Gracetime] = {"nfsv4gracetime", &transaction_ops, S_IWUSR|S_IRUSR},
1361+
#ifdef CONFIG_NFSD_LEGACY_CLIENT_TRACKING
13631362
[NFSD_RecoveryDir] = {"nfsv4recoverydir", &transaction_ops, S_IWUSR|S_IRUSR},
1363+
#endif
13641364
[NFSD_V4EndGrace] = {"v4_end_grace", &transaction_ops, S_IWUSR|S_IRUGO},
13651365
#endif
13661366
/* last one */ {""}

0 commit comments

Comments
 (0)