Skip to contentSkip to conversation

cramfs: small stat(2) fix

PATCH In review [email protected] 2 participants 2 messages Mar 5, 2005 – Mar 9, 2005 Cramfs filesystem

lore
Share & tools
lore
#0 lore raw

PATCH 1/5 cramfs: small stat(2) fix

From: Eric Lammerts <[email protected]>

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.

---

 25-akpm/fs/cramfs/inode.c |    1 +
 1 files changed, 1 insertion(+)
fs/cramfs/inode.c renamed from fs/cramfs/inode.c~cramfs-small-stat2-fix +1 -0
diff -puN fs/cramfs/inode.c~cramfs-small-stat2-fix fs/cramfs/inode.c
@@ -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));
 		}

_

#1 lore raw
Quoted 9 lines · On Fri, Mar 04, 2005 at 01:16:54PM -0800, [email protected] wrote:

From: Eric Lammerts <[email protected]>

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.

Added to the -stable queue, thanks.

greg k-h