On Wed, Mar 17, 2010 at 08:09:12PM +0300, Dmitry Monakhov wrote: > > This patch fix nasty bug with truncate on swapfile. > It contains only vfs core helpers and fix isize check path for > fs w/o i_op->setattr method. Later i'll send corresponding changes > to other fs which has ->setattr method. > > This patch is depends on Nick's patch > http://marc.info/?l=linux-fsdevel&m=126752788514574&w=2 > > >From e8587585b2e2fefb75d47f8d50ddc7099a50873c Mon Sep 17 00:00:00 2001 > From: Dmitry Monakhov <dmonakhov@xxxxxxxxxx> > Date: Wed, 17 Mar 2010 19:49:22 +0300 > Subject: [PATCH] vfs: reorganize inode chattr checks > > vmtrucate may fail due to IS_SWAPFILE flag or due to RLIMIT_FSIZE. > In some situations it is not acceptable behaviour. Off course > we can check IS_SWAPFILE before but what about RLIMIT_FSIZE? > > Let's divide newsize seting logic in two parts > First which perform necessery size checks > Second which does the work and can not fail. > And perform size check before any inode modifications. Yep, I think it is a good idea to perform these checks as early as possible. -- To unsubscribe from this list: send the line "unsubscribe linux-fsdevel" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html