Skip to contentSkip to conversation

Kernel 2.6.4 Hang in utime() on swap file

DISCUSSION Michael W. Shaffer 3 participants 3 messages Mar 20, 2004 – Mar 21, 2004

lore
Share & tools
lore
#0 lore raw

I have a Debian Sarge system running a 2.6 kernel (tested with 2.6.2, 2.6.3, 2.6.4 with the same behavior as described here), and am seeing un-killable hanging processes with our particular backup product.

When the backup disk agent process is running, one the the last files it tries to back up is a swap file at the path /swapfile00. The read of the file appears to work fine, but then it wants to call utime() to reset the atime/mtime on the file, and at this point the process becomes infinitely hung, doing nothing, no more output from strace, never terminating.

This only occurs if the swapfile is actively in use when the backup runs. If I run swapoff to deactivate the swapfile, then the utime() call apparently completes and the process immediately finishes and exits normally. If the swapfile is not in use at all, everything works fine.

As a workaround, I am just going to leave this swapfile inactive, since it's not really used much anyway. I do not observe this behavior on the same machine running a 2.4.21-xfs kernel.

__________________________________
Do you Yahoo!?
Yahoo! Finance Tax Center - File online. File on time.
http://taxes.yahoo.com/filing.html

#1 lore raw
Quoted 11 lines · Michael W. Shaffer

I have a Debian Sarge system running a 2.6 kernel (tested with 2.6.2, 2.6.3, 2.6.4 with the same behavior as described here), and am seeing un-killable hanging processes with our particular backup product.

When the backup disk agent process is running, one the the last files it tries to back up is a swap file at the path /swapfile00. The read of the file appears to work fine, but then it wants to call utime() to reset the atime/mtime on the file, and at this point the process becomes infinitely hung, doing nothing, no more output from strace, never terminating.

Quoted 5 lines

This only occurs if the swapfile is actively in use when the backup runs. If I run swapoff to deactivate the swapfile, then the utime() call apparently completes and the process immediately finishes and exits normally. If the swapfile is not in use at all, everything works fine.

ho hum. We do this to prevent anyone from ftruncate()ing the swapfile while it is in use. That can destroy filesystems. Let me think about it a bit.

#2 lore raw

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Quoted 3 lines · Andrew Morton

ho hum. We do this to prevent anyone from ftruncate()ing the swapfile while it is in use. That can destroy filesystems. Let me think about it a bit.

Maybe you can deny to open such files with proxy file ops and proxy block dev ops.

So you implement all file operations and just give back errors. This has no speed penalty for the hot path and implements correct error handling.

Only penalty is code bloat, but this is normal for additional error handling ;-)

But maybe I'm totally wrong here and this is just another case of "doctor it hurts...".

Regards

Ingo Oeser

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.4 (GNU/Linux)

iD8DBQFAXWXhU56oYWuOrkARAtRAAKDjjyxyXbuH1LS+cJjGIduWYvEc7gCg4Cy2 wfjw7RtJtABR0MtvL07UPGw=
=rB7n
-----END PGP SIGNATURE-----