From 5b458b883b2984400aaa8d5215b9e5186d563c42 Mon Sep 17 00:00:00 2001 From: johann Date: Fri, 3 Apr 2009 23:38:58 +0000 Subject: [PATCH] Branch b1_8 b=18695 i=adilger Add LASSERTF in fsfilt_ext3_setattr() when truncating a directory. --- lustre/lvfs/fsfilt_ext3.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/lustre/lvfs/fsfilt_ext3.c b/lustre/lvfs/fsfilt_ext3.c index 4554eb6..f222a8f 100644 --- a/lustre/lvfs/fsfilt_ext3.c +++ b/lustre/lvfs/fsfilt_ext3.c @@ -510,6 +510,10 @@ static int fsfilt_ext3_setattr(struct dentry *dentry, void *handle, struct inode *inode = dentry->d_inode; int rc = 0; + LASSERTF(!(iattr->ia_valid & ATTR_SIZE) || !S_ISDIR(inode->i_mode), + "changing i_size on directory #%lu (%p) new %lu old %lu\n", + inode->i_ino, inode, iattr->ia_size, i_size_read(inode)); + /* Avoid marking the inode dirty on the superblock list unnecessarily. * We are already writing the inode to disk as part of this * transaction and want to avoid a lot of extra inode writeout -- 1.8.3.1