* [NFS] Increase size of struct fid raw buffer
@ 2008-04-07 9:47 Steven Whitehouse
2008-04-07 15:54 ` Linus Torvalds
0 siblings, 1 reply; 7+ messages in thread
From: Steven Whitehouse @ 2008-04-07 9:47 UTC (permalink / raw)
To: torvalds
Cc: linux-kernel, Christoph Hellwig, Neil Brown, J. Bruce Fields,
Adrian Bunk
>From ba713d661333d790db5106c54d1f0ee94a876944 Mon Sep 17 00:00:00 2001
From: Steven Whitehouse <swhiteho@redhat.com>
Date: Mon, 7 Apr 2008 09:53:24 +0100
Subject: [PATCH] [NFS] Increase size of struct fid raw buffer
GFS2 requires the NFS filehandle buffer to be larger than the
minimum size as per the bug report: http://lkml.org/lkml/2007/10/24/374
Its a pretty trivial fix for now and I've done a test which shows
that it works ok.
Signed-off-by: Steven Whitehouse <swhiteho@redhat.com>
Cc: Christoph Hellwig <hch@infradead.org>
Cc: Neil Brown <neilb@suse.de>
Cc: J. Bruce Fields <bfields@fieldses.org>
Cc: Adrian Bunk <bunk@kernel.org>
diff --git a/include/linux/exportfs.h b/include/linux/exportfs.h
index adcbb05..a6e928d 100644
--- a/include/linux/exportfs.h
+++ b/include/linux/exportfs.h
@@ -43,7 +43,7 @@ struct fid {
u32 parent_ino;
u32 parent_gen;
} i32;
- __u32 raw[6];
+ __u32 raw[8];
};
};
--
1.5.1.2
^ permalink raw reply related [flat|nested] 7+ messages in thread
* Re: [NFS] Increase size of struct fid raw buffer
2008-04-07 9:47 [NFS] Increase size of struct fid raw buffer Steven Whitehouse
@ 2008-04-07 15:54 ` Linus Torvalds
2008-04-08 7:50 ` Steven Whitehouse
0 siblings, 1 reply; 7+ messages in thread
From: Linus Torvalds @ 2008-04-07 15:54 UTC (permalink / raw)
To: Steven Whitehouse
Cc: linux-kernel, Christoph Hellwig, Neil Brown, J. Bruce Fields,
Adrian Bunk
On Mon, 7 Apr 2008, Steven Whitehouse wrote:
>
> GFS2 requires the NFS filehandle buffer to be larger than the
> minimum size as per the bug report: http://lkml.org/lkml/2007/10/24/374
> Its a pretty trivial fix for now and I've done a test which shows
> that it works ok.
I'm not seeing the point of this.
Every single instance of "struct fid" that I saw in a quick grep was
created not as a "struct fid", but as some other data structure that was
then cast to a "struct fid *".
So the _underlying_ size of "struct fid" seems to be pretty random, and
totally unrelated to this declaration.
But admittedly that really was just a quick grep, and maybe I missed
something. But it seems like this patch doesn't really change anything,
just largely makes a change in a structure that is apparently used as an
opaque pointer.
Is there anything that actually uses "struct fid" as an _allocation_
entity?
And if not, then that "_u32 raw[6]" should probably be a un-sized "_u32
raw[]" instead, no?
Linus
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [NFS] Increase size of struct fid raw buffer
2008-04-07 15:54 ` Linus Torvalds
@ 2008-04-08 7:50 ` Steven Whitehouse
2008-04-08 7:58 ` Christoph Hellwig
0 siblings, 1 reply; 7+ messages in thread
From: Steven Whitehouse @ 2008-04-08 7:50 UTC (permalink / raw)
To: Linus Torvalds
Cc: linux-kernel, Christoph Hellwig, Neil Brown, J. Bruce Fields,
Adrian Bunk
Hi,
On Mon, 2008-04-07 at 08:54 -0700, Linus Torvalds wrote:
>
> On Mon, 7 Apr 2008, Steven Whitehouse wrote:
> >
> > GFS2 requires the NFS filehandle buffer to be larger than the
> > minimum size as per the bug report: http://lkml.org/lkml/2007/10/24/374
> > Its a pretty trivial fix for now and I've done a test which shows
> > that it works ok.
>
> I'm not seeing the point of this.
>
> Every single instance of "struct fid" that I saw in a quick grep was
> created not as a "struct fid", but as some other data structure that was
> then cast to a "struct fid *".
>
> So the _underlying_ size of "struct fid" seems to be pretty random, and
> totally unrelated to this declaration.
>
> But admittedly that really was just a quick grep, and maybe I missed
> something. But it seems like this patch doesn't really change anything,
> just largely makes a change in a structure that is apparently used as an
> opaque pointer.
>
> Is there anything that actually uses "struct fid" as an _allocation_
> entity?
>
> And if not, then that "_u32 raw[6]" should probably be a un-sized "_u32
> raw[]" instead, no?
>
> Linus
I'm happy with that solution, although I'd assumed that the reason this
field had a size in the first place was that the NFS people had a plan
to use the structure as an allocation entity in the future. Can an NFS
developer please confirm/deny this?
If everybody is happy with the plan, then I'll send a patch to make the
change as you suggest shortly,
Steve.
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [NFS] Increase size of struct fid raw buffer
2008-04-08 7:50 ` Steven Whitehouse
@ 2008-04-08 7:58 ` Christoph Hellwig
2008-04-08 9:57 ` Steven Whitehouse
2008-04-08 13:01 ` [NFS] Use a zero sized array for raw field in struct fid Steven Whitehouse
0 siblings, 2 replies; 7+ messages in thread
From: Christoph Hellwig @ 2008-04-08 7:58 UTC (permalink / raw)
To: Steven Whitehouse
Cc: Linus Torvalds, linux-kernel, Christoph Hellwig, Neil Brown,
J. Bruce Fields, Adrian Bunk
On Tue, Apr 08, 2008 at 08:50:05AM +0100, Steven Whitehouse wrote:
> I'm happy with that solution, although I'd assumed that the reason this
> field had a size in the first place was that the NFS people had a plan
> to use the structure as an allocation entity in the future. Can an NFS
> developer please confirm/deny this?
>
> If everybody is happy with the plan, then I'll send a patch to make the
> change as you suggest shortly,
I've introduce it and I don't plan to use it as allocation entity. I
don't quite remember why I sized it either, so it's conceptually fine
to make it a VLA. Just do some testing with that variant please.
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [NFS] Increase size of struct fid raw buffer
2008-04-08 7:58 ` Christoph Hellwig
@ 2008-04-08 9:57 ` Steven Whitehouse
2008-04-08 13:01 ` [NFS] Use a zero sized array for raw field in struct fid Steven Whitehouse
1 sibling, 0 replies; 7+ messages in thread
From: Steven Whitehouse @ 2008-04-08 9:57 UTC (permalink / raw)
To: Christoph Hellwig
Cc: Linus Torvalds, linux-kernel, Neil Brown, J. Bruce Fields,
Adrian Bunk
Hi,
On Tue, 2008-04-08 at 03:58 -0400, Christoph Hellwig wrote:
> On Tue, Apr 08, 2008 at 08:50:05AM +0100, Steven Whitehouse wrote:
> > I'm happy with that solution, although I'd assumed that the reason this
> > field had a size in the first place was that the NFS people had a plan
> > to use the structure as an allocation entity in the future. Can an NFS
> > developer please confirm/deny this?
> >
> > If everybody is happy with the plan, then I'll send a patch to make the
> > change as you suggest shortly,
>
> I've introduce it and I don't plan to use it as allocation entity. I
> don't quite remember why I sized it either, so it's conceptually fine
> to make it a VLA. Just do some testing with that variant please.
Then we get this:
In file included from mm/shmem.c:30:
include/linux/exportfs.h:46: error: flexible array member in union
make[1]: *** [mm/shmem.o] Error 1
make: *** [mm] Error 2
but we can have a zero length array though, so I'll test that and send a
patch in due course,
Steve.
^ permalink raw reply [flat|nested] 7+ messages in thread
* [NFS] Use a zero sized array for raw field in struct fid
2008-04-08 7:58 ` Christoph Hellwig
2008-04-08 9:57 ` Steven Whitehouse
@ 2008-04-08 13:01 ` Steven Whitehouse
2008-04-09 16:13 ` J. Bruce Fields
1 sibling, 1 reply; 7+ messages in thread
From: Steven Whitehouse @ 2008-04-08 13:01 UTC (permalink / raw)
To: Linus Torvalds
Cc: linux-kernel, Neil Brown, J. Bruce Fields, Adrian Bunk,
ChristophHellwig
>From b8732f8bea4e8abc331b8fa58a4047c91e2e7d02 Mon Sep 17 00:00:00 2001
From: Steven Whitehouse <swhiteho@redhat.com>
Date: Tue, 8 Apr 2008 13:12:52 +0100
Subject: [PATCH] [NFS] Use a zero sized array for raw field in struct fid
The raw field's size can vary so we use a zero sized array since
gcc will not allow a variable sized array inside a union. This
has been tested with ext3 and gfs2 and relates to the bug
report: http://lkml.org/lkml/2007/10/24/374 and discussion
thread: http://lkml.org/lkml/2008/4/7/65
Signed-off-by: Steven Whitehouse <swhiteho@redhat.com>
Cc: Christoph Hellwig <hch@infradead.org>
Cc: Neil Brown <neilb@suse.de>
Cc: J. Bruce Fields <bfields@fieldses.org>
Cc: Adrian Bunk <bunk@kernel.org>
diff --git a/include/linux/exportfs.h b/include/linux/exportfs.h
index adcbb05..de8387b 100644
--- a/include/linux/exportfs.h
+++ b/include/linux/exportfs.h
@@ -43,7 +43,7 @@ struct fid {
u32 parent_ino;
u32 parent_gen;
} i32;
- __u32 raw[6];
+ __u32 raw[0];
};
};
--
1.5.1.2
^ permalink raw reply related [flat|nested] 7+ messages in thread
* Re: [NFS] Use a zero sized array for raw field in struct fid
2008-04-08 13:01 ` [NFS] Use a zero sized array for raw field in struct fid Steven Whitehouse
@ 2008-04-09 16:13 ` J. Bruce Fields
0 siblings, 0 replies; 7+ messages in thread
From: J. Bruce Fields @ 2008-04-09 16:13 UTC (permalink / raw)
To: Steven Whitehouse
Cc: Linus Torvalds, linux-kernel, Neil Brown, Adrian Bunk,
ChristophHellwig
On Tue, Apr 08, 2008 at 02:01:26PM +0100, Steven Whitehouse wrote:
> >From b8732f8bea4e8abc331b8fa58a4047c91e2e7d02 Mon Sep 17 00:00:00 2001
> From: Steven Whitehouse <swhiteho@redhat.com>
> Date: Tue, 8 Apr 2008 13:12:52 +0100
> Subject: [PATCH] [NFS] Use a zero sized array for raw field in struct fid
>
> The raw field's size can vary so we use a zero sized array since
> gcc will not allow a variable sized array inside a union. This
> has been tested with ext3 and gfs2 and relates to the bug
> report: http://lkml.org/lkml/2007/10/24/374 and discussion
> thread: http://lkml.org/lkml/2008/4/7/65
OK; queued for 2.6.26.--b.
>
> Signed-off-by: Steven Whitehouse <swhiteho@redhat.com>
> Cc: Christoph Hellwig <hch@infradead.org>
> Cc: Neil Brown <neilb@suse.de>
> Cc: J. Bruce Fields <bfields@fieldses.org>
> Cc: Adrian Bunk <bunk@kernel.org>
>
> diff --git a/include/linux/exportfs.h b/include/linux/exportfs.h
> index adcbb05..de8387b 100644
> --- a/include/linux/exportfs.h
> +++ b/include/linux/exportfs.h
> @@ -43,7 +43,7 @@ struct fid {
> u32 parent_ino;
> u32 parent_gen;
> } i32;
> - __u32 raw[6];
> + __u32 raw[0];
> };
> };
>
> --
> 1.5.1.2
>
>
>
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2008-04-09 16:13 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-04-07 9:47 [NFS] Increase size of struct fid raw buffer Steven Whitehouse
2008-04-07 15:54 ` Linus Torvalds
2008-04-08 7:50 ` Steven Whitehouse
2008-04-08 7:58 ` Christoph Hellwig
2008-04-08 9:57 ` Steven Whitehouse
2008-04-08 13:01 ` [NFS] Use a zero sized array for raw field in struct fid Steven Whitehouse
2008-04-09 16:13 ` J. Bruce Fields
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox