Change in NFS client behavior

From: Rob Sims
Date: Wed Aug 31 2005 - 09:56:17 EST


We have noticed when changing from kernel 2.4.23 to 2.6.8 that
timestamps of files are not changed if opened for a write and nothing is
written. When using 2.4.23 timestamps are changed. When using a local
filesystem (reiserfs) with either kernel, timestamps are changed.
Symptoms vary with the client, not the server. See the script below.

When run on a 2.4.23 machine in an NFS mounted directory, output is
"Good." When run on a 2.6.8 or 2.6.12-rc4 machine in an NFS directory,
output is "Error."

Is this a bug? How do we revert to the 2.4/local fs behavior?

Thanks,
Rob

#!/bin/sh

if [ -n "$1" ]; then
if [ -e "$1" ]; then
printf "%s exists - please specify a new file name.\n" "$1"
else
touch $1
origtime=`stat -c '%X %Y %Z' "$1"`
sleep 5
cat /dev/null > "$1"
newtime=`stat -c '%X %Y %Z' "$1"`
rm "$1"

printf "%s\n%s\n" "$origtime" "$newtime"
if [ "$origtime" = "$newtime" ]; then
printf "Error - timestamps not modified\n"
else
printf "Good - timestamps modified\n"
fi
fi
else
printf "Please specify a file name.\n"
fi
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/