Re: help with ext3 reserved inode

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

 



On Tue, Jul 7, 2009 at 6:16 PM, Donato Capitella<d.capitella@xxxxxx> wrote:
> On Tue, 2009-07-07 at 15:46 +0530, Manish Katiyar wrote:
>> On Tue, Jul 7, 2009 at 3:21 PM, Donato Capitella<d.capitella@xxxxxx> wrote:
>> > On Tue, 2009-07-07 at 15:10 +0530, Manish Katiyar wrote:
>> >> On Tue, Jul 7, 2009 at 2:41 PM, Donato Capitella<d.capitella@xxxxxx> wrote:
>> >> >
>> >> > 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.
>> > journal after calling ext3_iget() has value -5.
>>
>> OK.... I think I understand your problem. My guess is that you chose
>> the inode number to be 3 , but forgot to update the below function
>>
>> static inline int ext3_valid_inum(struct super_block *sb, unsigned
>> long ino)
>> {
>>         return ino == EXT3_ROOT_INO ||
>>                 ino == EXT3_JOURNAL_INO ||
>>                 ino == EXT3_RESIZE_INO ||
>>                 (ino >= EXT3_FIRST_INO(sb) &&
>>                  ino <= le32_to_cpu(EXT3_SB(sb)->s_es->s_inodes_count));
>> }
>
> Thanks, this helped. I just modified ext3_valid_inum() to accept inode
> 3. Unfortunatelly, now I get error -116.

And this time you are probably hitting this code in ext3_iget()
because you forgot to initialize inode->i_nlink.

      if (inode->i_nlink == 0) {
                if (inode->i_mode == 0 ||
                    !(EXT3_SB(inode->i_sb)->s_mount_state & EXT3_ORPHAN_FS)) {
                        /* this inode is deleted */
                        brelse (bh);
                        ret = -ESTALE;
                        goto bad_inode;
                }
                /* The only unlinked inodes we let through here have
                 * valid i_mode and are being read by the orphan
                 * recovery code: that's fine, we're about to complete
                 * the process of deleting those. */
        }

> How do I understand what this
> error corresponds to? Is it documented somewhere?

This error corresponds to -ESTALE. See the file
include/asm-generic/errno.h in kernel source tree.

Hope that helps

Thanks -
Manish

>
>



-- 
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



[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