public inbox for linux-xfs@vger.kernel.org
 help / color / mirror / Atom feed
From: Eric Sandeen <sandeen@sandeen.net>
To: Brian Foster <bfoster@redhat.com>
Cc: Eric Sandeen <sandeen@redhat.com>, xfs@oss.sgi.com
Subject: Re: [PATCH 12/13] xfs_repair: don't clear . or .. in process_dir2_data
Date: Thu, 19 Mar 2015 12:59:15 -0500	[thread overview]
Message-ID: <550B0E73.2020602@sandeen.net> (raw)
In-Reply-To: <20150319175431.GG11669@laptop.bfoster>

On 3/19/15 12:54 PM, Brian Foster wrote:
> On Thu, Mar 19, 2015 at 12:29:27PM -0500, Eric Sandeen wrote:
>> On 3/19/15 11:47 AM, Brian Foster wrote:
>>> On Tue, Mar 17, 2015 at 03:33:14PM -0500, Eric Sandeen wrote:
>>>> process_dir2_data() has special . and .. processing; it is able
>>>> to correct these inodes, so there is no reason to clear them.
>>>>
>>>> Signed-off-by: Eric Sandeen <sandeen@redhat.com>
>>>> ---
>>>>  repair/dir2.c |   12 ++++++++++++
>>>>  1 files changed, 12 insertions(+), 0 deletions(-)
>>>>
>>>> diff --git a/repair/dir2.c b/repair/dir2.c
>>>> index 9e6c67d..3acf71c 100644
>>>> --- a/repair/dir2.c
>>>> +++ b/repair/dir2.c
>>>> @@ -1331,6 +1331,18 @@ _("entry at block %u offset %" PRIdPTR " in directory inode %" PRIu64
>>>>  				dep->namelen = 1;
>>>>  			clearino = 1;
>>>>  		}
>>>> +
>>>> +		/*
>>>> +		 * We have a special dot & dotdot fixer-upper below which can
>>>> +		 * sort out the proper inode number, so don't clear it.
>>>> +		 */
>>>> +		if ((dep->namelen == 1 && dep->name[0] == '.') ||
>>>> +		    (dep->namelen == 2 &&
>>>> +		     dep->name[0] == '.' && dep->name[1] == '.')) {
>>>> +			clearino = 0;
>>>> +			clearreason = NULL;
>>>> +		}
>>>> +		    
>>>
>>> Whitespace damage on the blank line above.
>>>
>>> Seems Ok, but the question I have is what happens if the dot or dotdot
>>> namelen was bogus? 
>>
>> If namelen is 1 and name[0] is '.', or
>> if namelen is 2 and name[0] is '.' and name[1] is '..'
>>
>> then how can that the len be bogus?  The test is for the name being
>> either precisely '.' or '..' and nothing else, right?
>>
> 
> Ah, yeah I see. So it would be cleared in that case.
> 
> Note that just above if namelen == 0 we set it to 1. Would we have the
> opposite problem for hidden files with bogus namelen (i.e., not clear
> entries that we should)?

Hm, yeah.  Maybe moving my new hunk above that check makes sense.

-Eric

_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs

  reply	other threads:[~2015-03-19 17:59 UTC|newest]

Thread overview: 39+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-03-17 20:33 [PATCH 00/13] xfsprogs: roll-up of previously sent patches Eric Sandeen
2015-03-17 20:33 ` [PATCH 01/13] xfs_db: Allow writes of corrupted data by optionally skipping write verifiers Eric Sandeen
2015-03-19 15:07   ` Brian Foster
2015-03-23 20:00   ` [PATCH 01/13 V2] " Eric Sandeen
2015-03-24 12:07     ` Brian Foster
2015-03-17 20:33 ` [PATCH 02/13] xfs_db: fix inode CRC validity state, and warn on read if invalid Eric Sandeen
2015-03-19 15:07   ` Brian Foster
2015-03-21  2:26     ` Eric Sandeen
2015-03-21 14:18       ` Brian Foster
2015-03-23 20:11   ` [PATCH 02/13 V2] " Eric Sandeen
2015-03-24 12:07     ` Brian Foster
2015-03-17 20:33 ` [PATCH 03/13] xfs_db: add crc manipulation commands Eric Sandeen
2015-03-19 15:07   ` Brian Foster
2015-03-21  2:30     ` Eric Sandeen
2015-03-21 14:18       ` Brian Foster
2015-03-23 20:01   ` [PATCH 03/13 DROP] " Eric Sandeen
2015-03-17 20:33 ` [PATCH 04/13] xfs_db: nlink fields are valid for di_version == 3, too Eric Sandeen
2015-03-17 20:33 ` [PATCH 05/13] xfs_repair: dirty inode in process_sf_dir2 if we change namelen Eric Sandeen
2015-03-17 20:33 ` [PATCH 06/13] xfs_repair: remove impossible tests in process_sf_dir2 Eric Sandeen
2015-03-17 20:33 ` [PATCH 07/13] xfs_repair: collapse 2 cases " Eric Sandeen
2015-03-17 20:33 ` [PATCH 08/13] xfs_repair: remove last-entry hack " Eric Sandeen
2015-03-17 20:33 ` [PATCH 09/13] libxfs: remove ASSERT on ftype read from disk Eric Sandeen
2015-03-19 16:46   ` Brian Foster
2015-03-19 17:27     ` Eric Sandeen
2015-03-23 20:13   ` PATCH 09/13 V2] " Eric Sandeen
2015-03-24 12:07     ` Brian Foster
2015-03-17 20:33 ` [PATCH 10/13] xfs_repair: clear need_root_dotdot if we rebuild the root dir Eric Sandeen
2015-03-17 20:33 ` [PATCH 11/13] xfs_repair: set *parent if process_dir2_data() fixes root inode Eric Sandeen
2015-03-17 20:33 ` [PATCH 12/13] xfs_repair: don't clear . or .. in process_dir2_data Eric Sandeen
2015-03-19 16:47   ` Brian Foster
2015-03-19 17:29     ` Eric Sandeen
2015-03-19 17:54       ` Brian Foster
2015-03-19 17:59         ` Eric Sandeen [this message]
2015-03-19 18:07           ` Brian Foster
2015-03-23 20:17   ` [PATCH 12/13 V2] " Eric Sandeen
2015-03-24 12:07     ` Brian Foster
2015-03-17 20:33 ` [PATCH 13/13] xfs_repair: validate & fix inode CRCs Eric Sandeen
2015-03-19 16:47   ` Brian Foster
2015-03-23 20:19   ` [PATCH 13/13 V2] " Eric Sandeen

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=550B0E73.2020602@sandeen.net \
    --to=sandeen@sandeen.net \
    --cc=bfoster@redhat.com \
    --cc=sandeen@redhat.com \
    --cc=xfs@oss.sgi.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