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

Neil Brown
2005-12-18T23:11:05Z

On Friday December 16, vonbrand@inf.utfsm.cl wrote:
> Horst von Brand <vonbrand@inf.utfsm.cl> 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);
}