From 1da4c14455ee94c3ba0795c3bcc39c6ee24f8c74 Mon Sep 17 00:00:00 2001 From: johann Date: Fri, 3 Apr 2009 23:34:24 +0000 Subject: [PATCH] Branch b1_6 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 e4124f1..8113033 100644 --- a/lustre/lvfs/fsfilt_ext3.c +++ b/lustre/lvfs/fsfilt_ext3.c @@ -503,6 +503,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