All of lore.kernel.org
 help / color / mirror / Atom feed
From: Kai Bankett <chaosman@ontika.net>
To: Al Viro <viro@ZenIV.linux.org.uk>
Cc: linux-fsdevel@vger.kernel.org
Subject: Re: [PATCH]QNX6 filesystem (RO) driver
Date: Fri, 17 Feb 2012 22:38:12 +0100	[thread overview]
Message-ID: <4F3EC8C4.3050707@ontika.net> (raw)
In-Reply-To: <20120217185335.GR23916@ZenIV.linux.org.uk>

Am 02/17/2012 07:53 PM, schrieb Al Viro:
>> Hmmm...
>>
>> +                               if (len == de->de_size)
>> +                                       /* normal filename */
>> +                                       ino = qnx6_match(s, len, name, de);
>> +                                       if (ino)
>> +                                               goto found;
>> +                               else if ((de->de_size == 0xff)&&
>>
>> Actually, gcc ought to have screamed at that.  Note that "else" here matches
>> the second "if", not the first one.  And you are not guaranteed that
>> ino has _ever_ been assigned anything; that comparison is deep in nasal
>> daemon country...
At least code was robust enough to deal with it ;)
I guess ino was set to 0 anyways by compiler? At least it does not seem 
to have been sort of random.
Otherwise testing would have shown strange effects - right?
However, fixed. I just re-added the braces. At some point in time there 
were some ... seem they got lost somewhere in mod space.

> And in the same area, what happens if you have a long entry *and* ask for
> lookup for name that is exactly 255 bytes long?  AFAICS, qnx6_match() will
> proceed to do memcmp() on 255 bytes - note that you pass it "len", not
> "thislen".  Might (at least in theory) run out of page before it stops...(
>
> Something like
> 	if (len<= QNX6_SHORT_NAME_MAX) {
> 		if (de->de_size != len)
> 			continue;
> 		<qnx6_match>
> 	} else {
> 		if (de->de_size != 0xff)
> 			continue;
> 		<qnx6_long_match>
> 	}
> would probably make sense...  Wait.  You've mentioned something about
> special characters in names forcing a longname entry even for short
> ones.  Could you elaborate?
I just checked, but could not get qnx to split a short name in a long 
filename node.
So we can bury that one ... also does not really make sense to design it 
that way.

To me the length field clearly is the master. For short filenames always 
de_size < 0xff and equal the filename length.
If de_size == 0xff, filename length has to be taken out of lf node.
The interesting question is: What is in between? To me, the answer is: 
File-system error land.

Just re-pull the patch and take a look ...
http://a6.ontika.net/patches/0001-fs-initial-qnx6fs-addition.patch.gz

BTW, I had a look at character and block device files. QNX drivers just 
dynamically add them to /dev if a driver offers any.
There seems to be no way to create or move any by hand + they are not 
written to the fs.


  reply	other threads:[~2012-02-17 20:38 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-02-01 20:41 [PATCH]QNX6 filesystem (RO) driver Kai Bankett
2012-02-12  4:56 ` Al Viro
2012-02-12 22:14   ` Kai Bankett
2012-02-12 22:43     ` Al Viro
2012-02-15  2:52       ` Kai Bankett
2012-02-15  6:10         ` Al Viro
2012-02-15  6:14           ` Al Viro
2012-02-15  6:47           ` Al Viro
2012-02-15  7:11             ` Al Viro
2012-02-15  7:57               ` Al Viro
2012-02-15 14:40                 ` Al Viro
2012-02-15 16:27                   ` Kai Bankett
2012-02-15 21:35                     ` Al Viro
2012-02-16 10:00                   ` Al Viro
2012-02-17 15:06                     ` Kai Bankett
2012-02-17 16:20                       ` Al Viro
2012-02-17 17:53                         ` Kai Bankett
2012-02-17 18:35                           ` Al Viro
2012-02-17 18:53                             ` Al Viro
2012-02-17 21:38                               ` Kai Bankett [this message]
2012-02-21 22:04                                 ` Al Viro
2012-02-21 22:09                                   ` Al Viro
2012-02-22 11:58                                     ` Kai Bankett

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=4F3EC8C4.3050707@ontika.net \
    --to=chaosman@ontika.net \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=viro@ZenIV.linux.org.uk \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.