Commit 99907aab authored by Hirofumi Ogawa's avatar Hirofumi Ogawa Committed by Linus Torvalds

[PATCH] remove read-only/immutable checks from fat_truncate

From: Christoph Hellwig <hch@lst.de>

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.
Signed-off-by: default avatarOGAWA Hirofumi <hirofumi@mail.parknet.co.jp>
Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
parent 11353a39
......@@ -90,12 +90,6 @@ void fat_truncate(struct inode *inode)
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.
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment