linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Namjae Jeon <linkinjeon@gmail.com>
To: OGAWA Hirofumi <hirofumi@mail.parknet.co.jp>
Cc: akpm@linux-foundation.org, linux-fsdevel@vger.kernel.org,
	linux-kernel@vger.kernel.org,
	Namjae Jeon <namjae.jeon@samsung.com>,
	Ravishankar N <ravi.n1@samsung.com>,
	Amit Sahrawat <a.sahrawat@samsung.com>
Subject: Re: [PATCH v5 7/8] fat (exportfs): rebuild directory-inode if fat_dget() fails
Date: Fri, 21 Dec 2012 14:03:19 +0900	[thread overview]
Message-ID: <CAKYAXd8GgrG+cMN_wQDFLiuXoBPbR7c6N9eZqGCrK-OH3HpuZA@mail.gmail.com> (raw)
In-Reply-To: <87623ydnvq.fsf@devron.myhome.or.jp>

2012/12/20, OGAWA Hirofumi <hirofumi@mail.parknet.co.jp>:
> Namjae Jeon <linkinjeon@gmail.com> writes:
>
>>> Okay, We will check how we can consolidate the 2 paths to avoid any
>>> issue.
>> Hi OGAWA.
>>
>> On checking fat_search_long() logic, it is observed that it performs
>> name based lookup of the entries in a given directory.
>> In fat_get_parent(), we do not have such information to use the
>> existing API to reconstruct the  parent inode.
>> Could you give me some hint or guide to consolidate smoothly
>> fat_search_long and current traverse_logic ?
>
> Hm, start with copy of fat_search_long() and refactoring it. With it, we
> will be able to avoid the fixed bugs.
>
> After that, we might be able to merge those somehow. Well, I'm not
> pretty sure without doing it actually though.
Hi OGAWA.

When we checked to merge it with fat_search_long, we really did not
find any possibility of code reusing for fat_traverse_cluster.
It will not be proper ? In case of fat_search_long()-> it is
performing a name based lookup in a particular directory.
While for reconnection with parent from NFS ? we do not have the name
of the parent directory. We are relying on ‘i_pos’ ? on disk position
of directory entry.
So, on first request for lookup for “..” (i.e if we call
fat_search_long(child_dir->d_inode, MSDOS_DOTDOT,2,slot_info) it will
return the directory entry for “..” itself.  From this entry we can
read the “log start” which is the starting cluster of the parent
directory, but instead we need the “directory entry” where this is
stored.
So, from this level we need to go further one level up and read the
parent ->parent-> cluster. After reading that cluster, we need to do a
lookup of the “required ipos” in this directory block.
i.e., if the path is A/B/C ? and we call the get_parent() from ‘C’. We
need to read the directory block contents of ‘A’ and from those
‘directory entries' compare the log_start with the log_start value of
B, which was obtained by doing a lookup “..” in C.
So, Instead of it, we suggest we fix the “infinite-loop” condition in
fat_traverse_logic and retain the code.
of course, we will test it with corrupted FATfs.
Please share your thoughts on this.

Thanks.
>
> Thanks.
> --
> OGAWA Hirofumi <hirofumi@mail.parknet.co.jp>
>

  reply	other threads:[~2012-12-21  5:10 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-11-21 13:25 [PATCH v5 7/8] fat (exportfs): rebuild directory-inode if fat_dget() fails Namjae Jeon
2012-12-03  9:57 ` OGAWA Hirofumi
2012-12-04  6:27   ` Namjae Jeon
2012-12-04  9:31     ` OGAWA Hirofumi
2012-12-05  6:01       ` Namjae Jeon
2012-12-05  9:02         ` OGAWA Hirofumi
2012-12-05 11:56           ` Namjae Jeon
2012-12-15 10:52             ` Namjae Jeon
2012-12-19 16:10               ` OGAWA Hirofumi
2012-12-21  5:03                 ` Namjae Jeon [this message]
2012-12-21  5:08                   ` Namjae Jeon
2012-12-21  8:19                     ` OGAWA Hirofumi
2012-12-21 10:15                       ` Namjae Jeon
2012-12-21 10:35                         ` OGAWA Hirofumi
2012-12-21 10:36                           ` OGAWA Hirofumi
2013-01-09  6:24                             ` Namjae Jeon
2013-01-20 11:06                               ` OGAWA Hirofumi
2013-01-22 10:31                                 ` Namjae Jeon
2013-01-26  4:22                                   ` OGAWA Hirofumi
2013-01-28  7:43                                     ` Namjae Jeon
2013-01-28 13:51                                       ` OGAWA Hirofumi
2013-01-29  5:05                                         ` Namjae Jeon

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CAKYAXd8GgrG+cMN_wQDFLiuXoBPbR7c6N9eZqGCrK-OH3HpuZA@mail.gmail.com \
    --to=linkinjeon@gmail.com \
    --cc=a.sahrawat@samsung.com \
    --cc=akpm@linux-foundation.org \
    --cc=hirofumi@mail.parknet.co.jp \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=namjae.jeon@samsung.com \
    --cc=ravi.n1@samsung.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).