public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* chmod of active swap file blocks
@ 2003-12-29  4:55 Paul Jakma
  2003-12-29  5:16 ` Paul Jakma
  2003-12-29  9:30 ` Andrew Morton
  0 siblings, 2 replies; 9+ messages in thread
From: Paul Jakma @ 2003-12-29  4:55 UTC (permalink / raw)
  To: Linux Kernel

Hi,

Trying to chmod a file being used for swap causes chmod() to block,
with permissions change /not/ having taken effect, until the swap
file is swapoff'd, at which point chmod() carries on and chmod (the
command) finishes.

# swapon /.swapfile 
# cat /proc/swaps 
Filename				Type		Size	Used	Priority
/dev/ide/host0/bus0/target0/lun0/part1   partition	200772	51748	-1
/.swapfile                               file		131064	0	-5
# strace chmod g-w /.swapfile 2> /tmp/strace-chmod &
[3] 29208
# tail /tmp/strace-chmod 
[ snip ]
stat64("/.swapfile", {st_mode=S_IFREG|0600, st_size=134217728, ...}) = 0
chmod("/.swapfile", 0600
# swapoff /.swapfile 
# 
[3]   Done                    strace chmod g-w /.swapfile 2>/tmp/strace-chmod

NB: no, i dont use devfs :) (just same namespace.)

regards,
-- 
Paul Jakma	paul@clubi.ie	paul@jakma.org	Key ID: 64A2FF6A
	warning: do not ever send email to spam@dishone.st
Fortune:
Save energy:  Drive a smaller shell.

^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2004-01-02  0:44 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2003-12-29  4:55 chmod of active swap file blocks Paul Jakma
2003-12-29  5:16 ` Paul Jakma
2003-12-29  9:30 ` Andrew Morton
2003-12-29 17:25   ` Paul Jakma
2004-01-01  8:19     ` Neale Banks
2004-01-01 10:12       ` Andrew Morton
2004-01-01 14:10         ` Andries Brouwer
2004-01-01 21:40           ` Erik Andersen
2004-01-02  0:43             ` Paul Jakma

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox