Re: NFS and partitioned md

From: Neil Brown
Date: Wed Jun 28 2006 - 23:48:27 EST


On Tuesday June 27, bugtraq@xxxxxxxxxx wrote:
> Hi,
>
> thx for your interrest,
>
> Neil Brown píše v Út 27. 06. 2006 v 10:32 +1000:
> > Odd. It works fine for me (I've had this sort of configuration on
> > some machines for ages, and I just tested a bleeding edge kernel and
> > it still works).
> >
> > So I suspect there is something else going on that has nothing to do
> > with the usage of partitioned md.... then again, maybe there is some
> > weird sign extension happening to '254' somewhere, though that would
> > be terribly strange.
> >
> > So: details please.
> > What md device exactly (major and minor)
> # mount | grep /mnt/data
> /dev/md_d64p9 on /mnt/data type ext3 (rw)
> /dev/loop/0 on /mnt/data-loop type ext3 (rw)
>
> # ls -al /dev/md_d64p9
> brw-rw---- 1 root disk 254, 4105 2006-06-27 10:17 /dev/md_d64p9
> # ls -al /dev/loop0
> lrwxrwxrwx 1 root root 6 2006-06-27 19:44 /dev/loop0 -> loop/0
> # ls -al /dev/loop/0
> brw-rw---- 1 root disk 7, 0 2006-06-27 19:45 /dev/loop/0
>
> (as I look on that it comes on my mind, that problem could be minor
> longer than 1 byte)
>

Exactly. 4105 > 256. Such devices need a different format filehandle
which didn't work until very recently due to a bug (obviously no-one
tried it until recently).

The patch below fixes the kernel so that this will work.
Alternately use md_d0 md_d1, md_d2, or md_d3. Then it will work with
no patches.

NeilBrown

-----------------------------
Fixing missing 'expkey' support for fsid type 3

From: Frank Filz <ffilzlnx@xxxxxxxxxx>

Type '3' is used for the fsid in filehandles when the device number
of the device holding the filesystem has more than 8 bits in either
major or minor.
Unfortunately expkey_parse doesn't recognise type 3. Fix this.

(Slighty modified from Frank's original)

Signed-Off-By: Frank Filz <ffilzlnx@xxxxxxxxxx>
Signed-off-by: Neil Brown <neilb@xxxxxxx>

### Diffstat output
./fs/nfsd/export.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff .prev/fs/nfsd/export.c ./fs/nfsd/export.c
--- .prev/fs/nfsd/export.c 2006-06-29 11:07:21.000000000 +1000
+++ ./fs/nfsd/export.c 2006-06-27 18:27:49.000000000 +1000
@@ -126,7 +126,7 @@ static int expkey_parse(struct cache_det
if (*ep)
goto out;
dprintk("found fsidtype %d\n", fsidtype);
- if (fsidtype > 2)
+ if (key_len(fsidtype)==0) /* invalid type */
goto out;
if ((len=qword_get(&mesg, buf, PAGE_SIZE)) <= 0)
goto out;
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/