xfs-masters
[Top] [All Lists]

[xfs-masters] Re: [2.6 patch] i386: always use 4k stacks

To: Horst von Brand <vonbrand@xxxxxxxxxxxx>
Subject: [xfs-masters] Re: [2.6 patch] i386: always use 4k stacks
From: Neil Brown <neilb@xxxxxxx>
Date: Mon, 19 Dec 2005 10:10:51 +1100
Cc: Adrian Bunk <bunk@xxxxxxxxx>, Dave Jones <davej@xxxxxxxxxx>, Andrew Morton <akpm@xxxxxxxx>, linux-kernel@xxxxxxxxxxxxxxx, arjan@xxxxxxxxxxxxx, xfs-masters@xxxxxxxxxxx, nathans@xxxxxxx
In-reply-to: message from Horst von Brand on Friday December 16
References: <vonbrand@inf.utfsm.cl> <200512161903.jBGJ3EnR003647@quelen.inf.utfsm.cl> <200512170017.jBH0HjSS004744@quelen.inf.utfsm.cl>
Reply-to: xfs-masters@xxxxxxxxxxx
Sender: xfs-masters-bounce@xxxxxxxxxxx
On Friday December 16, vonbrand@xxxxxxxxxxxx wrote:
> Horst von Brand <vonbrand@xxxxxxxxxxxx> wrote:
> [Forgot the attachment]

Thanks...
Based on that, I tried the following patch, and it didn't change the
amount of space that is reserved on the stack.
  gcc version 4.0.3 20051201 (prerelease) (Debian 4.0.2-5)

Further, earlier version of gcc miscompile this construct.
They effectively treat that in-line structure as a 'static', and
seeing notify_change changes .ia_valid, the next time it is called
contents of the structure will be wrong.

NeilBrown


### Diffstat output
 ./fs/nfsd/vfs.c |    6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff ./fs/nfsd/vfs.c~current~ ./fs/nfsd/vfs.c
--- ./fs/nfsd/vfs.c~current~    2005-12-19 09:44:20.000000000 +1100
+++ ./fs/nfsd/vfs.c     2005-12-19 09:56:46.000000000 +1100
@@ -923,11 +923,9 @@ nfsd_vfs_write(struct svc_rqst *rqstp, s
 
        /* clear setuid/setgid flag after write */
        if (err >= 0 && (inode->i_mode & (S_ISUID | S_ISGID))) {
-               struct iattr    ia;
-               ia.ia_valid = ATTR_KILL_SUID | ATTR_KILL_SGID;
-
                down(&inode->i_sem);
-               notify_change(dentry, &ia);
+               notify_change(dentry, &((struct iattr)
+                              {.ia_valid = ATTR_KILL_SUID | ATTR_KILL_SGID}));
                up(&inode->i_sem);
        }
 


<Prev in Thread] Current Thread [Next in Thread>