From: Rainer Schöpf Date: Mon, 18 Oct 2004 05:55:17 +0000 (+0000) Subject: STABLE12-linux-null-superblock-if-mount-failed-20040728 X-Git-Tag: openafs-stable-1_2_12~19 X-Git-Url: https://git.michaelhowe.org/gitweb/?a=commitdiff_plain;h=d68d71ecfff25a5bd6aaed0c9976d9c0b83ff9f6;p=packages%2Fo%2Fopenafs.git STABLE12-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. (cherry picked from commit e5e7801db895b1e57ff99fb59371aee47ac33b9c) --- diff --git a/src/afs/LINUX/osi_vfsops.c b/src/afs/LINUX/osi_vfsops.c index 6dc3a1380..18b320b6d 100644 --- a/src/afs/LINUX/osi_vfsops.c +++ b/src/afs/LINUX/osi_vfsops.c @@ -99,8 +99,14 @@ struct super_block *afs_read_super(struct super_block *sb, void *data, 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); +#else MOD_DEC_USE_COUNT; +#endif + } #if !defined(AFS_LINUX24_ENV) unlock_super(sb);