Blame test/nfs/nfs-dir.test

rpm-build 0a0c83
This is a regression test for a bug in 2.4 kernels. The test must be run
rpm-build 0a0c83
as root on a machine that has a loopback mounted NFS export. The mount
rpm-build 0a0c83
must have root squashing enabled. The test must be run in the root of
rpm-build 0a0c83
the nfs mount, and requires the following environment variable:
rpm-build 0a0c83
rpm-build 0a0c83
EXPORT_PATH => the path that is mounted at the working directory.
rpm-build 0a0c83
rpm-build 0a0c83
	Create a test directory and file.
rpm-build 0a0c83
rpm-build 0a0c83
	$ umask 022
rpm-build 0a0c83
	$ mkdir %{EXPORT_PATH}/test
rpm-build 0a0c83
	$ echo blah > %{EXPORT_PATH}/test/blah
rpm-build 0a0c83
rpm-build 0a0c83
	Make sure the file can be accessed before.
rpm-build 0a0c83
rpm-build 0a0c83
	$ su bin
rpm-build 0a0c83
	$ cat test/blah
rpm-build 0a0c83
	> blah
rpm-build 0a0c83
rpm-build 0a0c83
	Set up a situation that triggers the bug.
rpm-build 0a0c83
rpm-build 0a0c83
	$ su
rpm-build 0a0c83
	$ chmod go-rwx %{EXPORT_PATH}/test
rpm-build 0a0c83
	$ setfacl -m u:bin:rx %{EXPORT_PATH}/test
rpm-build 0a0c83
	$ ls -dl %{EXPORT_PATH}/test | awk '{print $1, $3, $4}'
rpm-build 0a0c83
	> drwxr-x---+ root root
rpm-build 0a0c83
	$ getfacl --omit-header %{EXPORT_PATH}/test 2> /dev/null
rpm-build 0a0c83
	> user::rwx
rpm-build 0a0c83
	> user:bin:r-x
rpm-build 0a0c83
	> group::---
rpm-build 0a0c83
	> mask::r-x
rpm-build 0a0c83
	> other::---
rpm-build 0a0c83
	>
rpm-build 0a0c83
rpm-build 0a0c83
	This should also succeed. With the bug, reading the file would
rpm-build 0a0c83
	fail with "Stale NFS file handle" or "Input/output error".
rpm-build 0a0c83
rpm-build 0a0c83
	$ su bin
rpm-build 0a0c83
	$ cat test/blah
rpm-build 0a0c83
	> blah
rpm-build 0a0c83
	$ sleep 3
rpm-build 0a0c83
	$ cat test/blah
rpm-build 0a0c83
	> blah
rpm-build 0a0c83
	$ cat test/blah
rpm-build 0a0c83
	> blah
rpm-build 0a0c83
rpm-build 0a0c83
	Clean up.
rpm-build 0a0c83
rpm-build 0a0c83
	$ su
rpm-build 0a0c83
	$ rm -rf %{EXPORT_PATH}/test