lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Tue, 24 Feb 2009 18:12:49 +0000 (GMT)
From:	Felipe Franciosi <ozzy@....ic.ac.uk>
To:	linux-ext4@...r.kernel.org
Subject: Re: Simple inode question (ext2/3)

My bad, I meant "bh->b_data" instead of "bh" (missed it while transcribing).
    ino = (struct ext3_inode *)(bh->b_data+(k*sizeof(struct ext3_inode)));

Still, my questions stand.
As a matter of fact, I might as well ask another noobie question: Do I have to "free" (or decrease any counters) after sb_getblk() ?

I appreciate any help,
Felipe

On Tue, 24 Feb 2009, Felipe Franciosi wrote:

> Hi there!
>
> I've been trying to write a kernel module that is capable of locating a specific mounted filesystem (ext2/3) and dump all the inode entries that are in use. I have two questions:
>
> 1) Is it possible to know if an inode is free just by looking to its (struct ext3_inode) info or do I have to check the inode bitmap for the specific block group?
>
> 2) Does the following look correct?
>
> --------8<--------
>
> struct vfsmount        *mountpoint = ... // fetch this from the proper namespace
> struct ext3_sb_info    *sbi = EXT3_SB(mountpoint->mnt_sb);
> struct ext3_group_desc *egd;
> struct ext3_inode      *ino;
> struct buffer_head     *bh;
> int i, j, k;
>
> for (i=0; i<sbi->s_groups_count; i++) {
> egd = ext3_get_group_desc(mountpoint->mnt_sb, i, NULL);
> for (j=0; j<(sbi->s_inodes_per_group)/(sbi->s_inodes_per_block); j++) {
>  bh = sb_getblk(mountpoint->mnt_sb, le32_to_cpu(egd->bg_inode_table+j));
>  for (k=0; k<sbi->s_inodes_per_block; k++) {
>   ino = (struct ext3_inode *)(bh+(k*sizeof(struct ext3_inode)));
>   // dump contents of ino
>   // index of ino should be: (i*(sbi->s_inodes_per_group)) + (j*(sbi->s_inodes_per_block)) + k
>  }
> }
> }
>
> --------8<--------
>
> Cheers,
> Felipe
>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-ext4" in
> the body of a message to majordomo@...r.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
>

--
To unsubscribe from this list: send the line "unsubscribe linux-ext4" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ