[DRBD-user] Stale NFS file handle vs. NFS-Server-README.txt

Lars Ellenberg Lars.Ellenberg at linbit.com
Tue Jun 8 23:35:58 CEST 2004

Note: "permalinks" may not be as permanent as we would like,
direct links of old sources may well be a few messages off.


/ 2004-06-08 22:58:21 +0200
\ Bernd Schubert:

> I still not understand whats causing this, but I'm pretty sure that the debian 
> nfs-kernel-server script cannot stop the nfs-server when nfs is started from 
> heartbeat. Just check it yourself, after running '/etc/init.d/heartbeat 
> stop', a 'ps ax' should show running nfs-daemons on this system. Those nfsd 
> processes can only be killed with 'killall -9 nfsd'. So I think after 
> stopping nfs, the nfs-daemons will survive and cause a stale filehandle when  
> drbd is stopped, probably they also ignore the 'exportfs -au' command.
> I'm also still wondering about the way the debian script is stopping nfs, I 
> checked the script of several distributions and either nfsd's are immediately 
> stopped with signal 9 or first with signal 15 and after a short break with 
> signal 9, however the debian script only stops the daemons with signal 1.


stange thing is, that there is a fuser -k -m $device in the drbd script,
which *should* deliver a kill -9 ...
maybe retrying some more times does help?

Index: drbd
===================================================================
RCS file: /home/lars/DRBD/CVSHOME/drbd/drbd/scripts/drbd,v
retrieving revision 1.58
diff -u -p -r1.58 drbd
--- drbd	1 Jun 2004 08:34:34 -0000	1.58
+++ drbd	8 Jun 2004 21:26:11 -0000
@@ -1569,7 +1569,7 @@ become_passive() # {{{2
 {
 	trace0
 	local res=$1
-	local errtxt status device command
+	local errtxt status device command retry
 
 	get_drbd_status $res || return 10
 	status=("${RET_VAL[@]}")
@@ -1612,19 +1612,22 @@ become_passive() # {{{2
 	mount_status $device
 	if [ -n "$RET_VAL" ]; then
 		note "'$res' $device is mounted on ${RET_VAL[2]}, trying to unmount"
-		if ! $UMOUNT $device &> /dev/null ; then
+
+		retry=3
+		while [ $retry -gt 0 ] ; do
+			myexec $UMOUNT $device && break
 			if ! $dontkill ; then
 				# umount failed, kill all processes accessing <device>
 				note "'$res' trying to kill users of $device"
 				myexec $FUSER -k -m $device > /dev/null
 			fi
 			sleep 3 # hopefully the signals get delivered within this time
-			# try again
-			myexec $UMOUNT $device || {
-				# failed again, FATAL
-				error "$UMOUNT $device FAILED"
-				return -1
-			}
+			let retry=retry-1
+		done
+		if [ $retry -le 0 ]; then
+			# failed $retry times, FATAL
+			error "$UMOUNT $device FAILED"
+			return -1
 		fi
 		echo "$link: '$res' $device unmounted"
 	fi



More information about the drbd-user mailing list