]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
[PATCH] cramfs: small stat(2) fix
authorEric Lammerts <eric@lammerts.org>
Sun, 13 Mar 2005 05:35:18 +0000 (21:35 -0800)
committerGreg KH <gregkh@suse.de>
Thu, 12 May 2005 17:00:07 +0000 (10:00 -0700)
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@lammerts.org>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
fs/cramfs/inode.c

index 23099366a8884025b21ecb9f2d3fd8e62085738d..6c285efa20043cb8dbb4692d7a53f5ff9455bac0 100644 (file)
@@ -70,6 +70,7 @@ static struct inode *get_cramfs_inode(struct super_block *sb, struct cramfs_inod
                        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));
                }