Re: help with ext3 reserved inode

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tue, Jul 7, 2009 at 3:10 PM, Manish Katiyar<mkatiyar@xxxxxxxxx> wrote:
> On Tue, Jul 7, 2009 at 2:41 PM, Donato Capitella<d.capitella@xxxxxx> wrote:
>> On Tue, 2009-07-07 at 00:10 +0530, Manish Katiyar wrote:
>>> Hmm.. Can you try to write something like ext3_get_journal() and tell
>>> us the errors you are enountering.
>>
>> Here's the function I wrote:
>>
>> /********************************************************/
>> struct inode *secdel_get_journal(struct super_block *sb)
>> {
>>        struct inode *journal;
>>
>>        journal = ext3_iget(sb, 3);
>>        if (IS_ERR(journal)) {
>>                printk(KERN_ERR "ext3secdel - no journal found.\n");
>>                return NULL;
>>        }
>>
>>        if (!S_ISREG(journal->i_mode)) {
>>                printk(KERN_ERR "ext3secdel - invalid journal inode.\n");
>>                iput(journal);
>>                return NULL;
>>        }
>>
>>        return journal;
>> }
>> /********************************************************/
>>
>> It doesn't crash, but stops on the first error, after the ext3_iget()
>> call and returns NULL.
>
> Can you also add print the value of journal after it is returned from
> ext3_iget() in debug statement. It will have the error code and will
> help to trace the problem.
>
>>
>>> And also could you post what is the
>>> output of "stat <3>" after you have initialized your reserved inode.
>>
>> Here's the output:
>
> May be you should also initialize i_nlinks = 1.
>
> Thanks -
> Manish
>
>
>>
>> Inode: 3 Type: regular Mode: 0600 Flags: 0x0 Generation: 0x0
>> User: 0 Group: 0 Size: 0
>> File ACL: 0 Directory ACL: 0
>> Links: 0 Blockcount: 0
>> Fragment: Address: 0 Number: 0 Size: 0
>> ctime: 0x4622bea1 -- Mon Apr 16 08:09:05 2007
>> atime: 0x462a2136 -- Sat Apr 21 22:35:34 2007
>> mtime: 0x4622325e -- Sun Apr 15 22:10:38 2007
>> BLOCKS:
>>

Surprisingly the type is shown as regular in the above case??????????
I doubt???


Here is what I can see with a freshly created file system.

[15:30:18 sinhas]$ sudo mke2fs /dev/mapper/vg-lvol1
[sudo] password for sinhas:
mke2fs 1.41.4 (27-Jan-2009)
Filesystem label=
OS type: Linux
Block size=1024 (log=0)
Fragment size=1024 (log=0)
25688 inodes, 102400 blocks
5120 blocks (5.00%) reserved for the super user
First data block=1
Maximum filesystem blocks=67371008
13 block groups
8192 blocks per group, 8192 fragments per group
1976 inodes per group
Superblock backups stored on blocks:
        8193, 24577, 40961, 57345, 73729

Writing inode tables: done
Writing superblocks and filesystem accounting information: done

This filesystem will be automatically checked every 34 mounts or
180 days, whichever comes first.  Use tune2fs -c or -i to override.
[/tmp]
[15:30:34 sinhas]$ sudo debugfs /dev/mapper/vg-lvol1
debugfs 1.41.4 (27-Jan-2009)
debugfs:  stat <3>
debugfs:

Inode: 3   Type: bad type    Mode:  0000   Flags: 0x0
Generation: 0    Version: 0x00000000
User:     0   Group:     0   Size: 0
File ACL: 0    Directory ACL: 0
Links: 0   Blockcount: 0
Fragment:  Address: 0    Number: 0    Size: 0
ctime: 0x00000000 -- Thu Jan  1 05:30:00 1970
atime: 0x00000000 -- Thu Jan  1 05:30:00 1970
mtime: 0x00000000 -- Thu Jan  1 05:30:00 1970
BLOCKS:






>> ps. never mind the dates, I put random values...
>>
>>> Instead of trying to reference any pointer and do any operation, could
>>> you just try to print success or the errno from the ext3_iget()
>>>
>>> Thanks -
>>> Manish
>>>
>> Thank you,
>> Donato
>>
>>
>
>
>
> --
> Thanks -
> Manish
>
> --
> To unsubscribe from this list: send an email with
> "unsubscribe kernelnewbies" to ecartis@xxxxxxxxxxxx
> Please read the FAQ at http://kernelnewbies.org/FAQ
>
>



-- 
Regards,
Sandeep.





 	
“To learn is to change. Education is a process that changes the learner.”

--
To unsubscribe from this list: send an email with
"unsubscribe kernelnewbies" to ecartis@xxxxxxxxxxxx
Please read the FAQ at http://kernelnewbies.org/FAQ



[Index of Archives]     [Newbies FAQ]     [Linux Kernel Mentors]     [Linux Kernel Development]     [IETF Annouce]     [Git]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux SCSI]     [Linux ACPI]
  Powered by Linux