[patch 1/5] cramfs: small stat(2) fix

From: akpm
Date: Fri Mar 04 2005 - 23:54:44 EST



From: Eric Lammerts <eric@xxxxxxxxxxxx>

When I stat(2) a device node on a cramfs, the st_blocks field is bogus
(it's derived from the size field which in this case holds the major/minor
numbers). This makes du(1) output completely wrong.

Signed-off-by: Eric Lammerts <eric@xxxxxxxxxxxx>
Signed-off-by: Andrew Morton <akpm@xxxxxxxx>
---

25-akpm/fs/cramfs/inode.c | 1 +
1 files changed, 1 insertion(+)

diff -puN fs/cramfs/inode.c~cramfs-small-stat2-fix fs/cramfs/inode.c
--- 25/fs/cramfs/inode.c~cramfs-small-stat2-fix 2005-03-04 13:15:57.000000000 -0800
+++ 25-akpm/fs/cramfs/inode.c 2005-03-04 13:15:57.000000000 -0800
@@ -70,6 +70,7 @@ static struct inode *get_cramfs_inode(st
inode->i_data.a_ops = &cramfs_aops;
} else {
inode->i_size = 0;
+ inode->i_blocks = 0;
init_special_inode(inode, inode->i_mode,
old_decode_dev(cramfs_inode->size));
}
_
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/