2005-03-01 17:10:45

by Eric Lammerts

[permalink] [raw]
Subject: [PATCH] cramfs: small stat(2) fix


Hi,
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.

Please apply the patch below.

Eric

Signed-off-by: Eric Lammerts <[email protected]>

--- linux-2.6.11-rc5/fs/cramfs/inode.c.orig 2005-03-01 11:10:29.000000000 -0500
+++ linux-2.6.11-rc5/fs/cramfs/inode.c 2005-03-01 11:10:36.000000000 -0500
@@ -70,6 +70,7 @@
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));
}