All of lore.kernel.org
 help / color / mirror / Atom feed
From: Christoph Hellwig <hch@lst.de>
To: hirofumi@mail.parknet.co.jp
Cc: linux-fsdevel@vger.kernel.org
Subject: [PATCH] remove read-only/immutable checks from fat_truncate
Date: Wed, 18 Aug 2004 16:38:13 +0200	[thread overview]
Message-ID: <20040818143813.GA3395@lst.de> (raw)

Looking through Herberts bind-mount patches I saw that fat_truncate
checks for the inode beeing read-only or immutable.

This looks wrong to me.  Rationale:

There's two callers:

 - the truncate path via notify_change, ->setattr, vmtruncate.  We
   already check for permissions here at the upper level
 - fat_delete_inode.  This one looks bogus to me - even if we delete
   an read-only or immutable inode we want to free the space allocated
   by it, else you leak disk blocks.


--- 1.25/fs/fat/file.c	2004-05-25 11:53:07 +02:00
+++ edited/fs/fat/file.c	2004-08-18 16:32:42 +02:00
@@ -90,12 +90,6 @@
 	const unsigned int cluster_size = sbi->cluster_size;
 	int nr_clusters;
 
-	/* Why no return value?  Surely the disk could fail... */
-	if (IS_RDONLY (inode))
-		return /* -EPERM */;
-	if (IS_IMMUTABLE(inode))
-		return /* -EPERM */;
-
 	/* 
 	 * This protects against truncating a file bigger than it was then
 	 * trying to write into the hole.

             reply	other threads:[~2004-08-18 14:38 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-08-18 14:38 Christoph Hellwig [this message]
2004-08-18 16:06 ` [PATCH] remove read-only/immutable checks from fat_truncate OGAWA Hirofumi

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=20040818143813.GA3395@lst.de \
    --to=hch@lst.de \
    --cc=hirofumi@mail.parknet.co.jp \
    --cc=linux-fsdevel@vger.kernel.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.