mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Andrew Morton <akpm@osdl.org>
To: Paul Jakma <paul@clubi.ie>
Cc: linux-kernel@vger.kernel.org
Subject: Re: chmod of active swap file blocks
Date: Mon, 29 Dec 2003 01:30:40 -0800	[thread overview]
Message-ID: <20031229013040.0a953dd0.akpm@osdl.org> (raw)
In-Reply-To: <Pine.LNX.4.56.0312290434360.2270@fogarty.jakma.org>

Paul Jakma <paul@clubi.ie> wrote:
>
> 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.

The kernel holds the swapfile's i_sem while it is in use.  This is to
prevent the filesystem destruction which would result if some silly person
were to truncate a swapfile while it was in active use.

It is not a particularly important safety feature ("don't do that") and it
can be taken out if it is causing serious side-effects.

Is chmod of an in-use swapfile an important thing to be able to do?

  parent reply	other threads:[~2003-12-29  9:31 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-12-29  4:55 Paul Jakma
2003-12-29  5:16 ` Paul Jakma
2003-12-29  9:30 ` Andrew Morton [this message]
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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20031229013040.0a953dd0.akpm@osdl.org \
    --to=akpm@osdl.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=paul@clubi.ie \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

Powered by JetHome