From e5e7801db895b1e57ff99fb59371aee47ac33b9c Mon Sep 17 00:00:00 2001 From: =?utf8?q?Rainer=20Sch=C3=B6pf?= Date: Thu, 29 Jul 2004 04:08:48 +0000 Subject: [PATCH] linux-null-superblock-if-mount-failed-20040728 FIXES 6002 The appended patch resets afs_globalVFS to NULL if /afs cannot be mounted, eg., if no cell server is accessible. There are two advantages: - it is possible to do "afsd -shutdown" to terminate all daemons - more importantly, if /afs cannot be mounted, the linux kernel will probably free the superblock, ie the memory pointed to afs_globalVFS. --- src/afs/LINUX/osi_vfsops.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/afs/LINUX/osi_vfsops.c b/src/afs/LINUX/osi_vfsops.c index 05d1e7c8c..3b895e4b5 100644 --- a/src/afs/LINUX/osi_vfsops.c +++ b/src/afs/LINUX/osi_vfsops.c @@ -138,12 +138,14 @@ afs_read_super(struct super_block *sb, void *data, int silent) sb->s_maxbytes = MAX_NON_LFS; #endif code = afs_root(sb); - if (code) + if (code) { + afs_globalVFS = NULL; #if defined(AFS_LINUX26_ENV) - module_put(THIS_MODULE); + module_put(THIS_MODULE); #else - MOD_DEC_USE_COUNT; + MOD_DEC_USE_COUNT; #endif + } #if !defined(AFS_LINUX24_ENV) unlock_super(sb); -- 2.39.5