lkml.org 
[lkml]   [2003]   [Dec]   [28]   [last100]   RSS Feed
Views: [more markup]  [less markup]  [headers]  [forward] 
 
Messages in this thread
/
DateMon, 29 Dec 2003 04:55:01 +0000 (GMT)
FromPaul Jakma <>
Subjectchmod of active swap file blocks
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.
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2005-03-22 12:59    [from the cache]
©2003-2008