2002-04-11 06:59:12

by Duncan Sands

[permalink] [raw]
Subject: 2.5.8-pre3 & ext3: cannot chown

The subject just about says it all. After 12 hours
of uptime running 2.5.8-pre3 on an ext3 partition,
I noticed that changing the owner of a file had no
effect. Rebooting with 2.4.18, there was no problem
in using chown.

All the best,

Duncan.


2002-04-11 07:19:21

by Andrew Morton

[permalink] [raw]
Subject: Re: 2.5.8-pre3 & ext3: cannot chown

Duncan Sands wrote:
>
> The subject just about says it all. After 12 hours
> of uptime running 2.5.8-pre3 on an ext3 partition,
> I noticed that changing the owner of a file had no
> effect. Rebooting with 2.4.18, there was no problem
> in using chown.

How does this look?

--- linux-2.5.8-pre3/fs/open.c Tue Apr 9 18:16:40 2002
+++ 25/fs/open.c Thu Apr 11 00:15:09 2002
@@ -524,11 +524,11 @@ static int chown_common(struct dentry *
goto out;
newattrs.ia_valid = ATTR_CTIME;
if (user != (uid_t) -1) {
- newattrs.ia_valid = ATTR_UID;
+ newattrs.ia_valid |= ATTR_UID;
newattrs.ia_uid = user;
}
if (group != (gid_t) -1) {
- newattrs.ia_valid = ATTR_GID;
+ newattrs.ia_valid |= ATTR_GID;
newattrs.ia_gid = group;
}
if (!S_ISDIR(inode->i_mode))

-

2002-04-11 14:29:54

by Alexander Viro

[permalink] [raw]
Subject: Re: 2.5.8-pre3 & ext3: cannot chown



On Thu, 11 Apr 2002, Andrew Morton wrote:

> Duncan Sands wrote:
> >
> > The subject just about says it all. After 12 hours
> > of uptime running 2.5.8-pre3 on an ext3 partition,
> > I noticed that changing the owner of a file had no
> > effect. Rebooting with 2.4.18, there was no problem
> > in using chown.
>
> How does this look?
>
> --- linux-2.5.8-pre3/fs/open.c Tue Apr 9 18:16:40 2002
> +++ 25/fs/open.c Thu Apr 11 00:15:09 2002
> @@ -524,11 +524,11 @@ static int chown_common(struct dentry *
> goto out;
> newattrs.ia_valid = ATTR_CTIME;
> if (user != (uid_t) -1) {
> - newattrs.ia_valid = ATTR_UID;
> + newattrs.ia_valid |= ATTR_UID;
> newattrs.ia_uid = user;
> }
> if (group != (gid_t) -1) {
> - newattrs.ia_valid = ATTR_GID;
> + newattrs.ia_valid |= ATTR_GID;


Good catch. Linus, please apply.

2002-04-11 19:00:16

by Duncan Sands

[permalink] [raw]
Subject: Re: 2.5.8-pre3 & ext3: cannot chown

On Thursday 11 April 2002 9:19 am, Andrew Morton wrote:
> Duncan Sands wrote:
> > The subject just about says it all. After 12 hours
> > of uptime running 2.5.8-pre3 on an ext3 partition,
> > I noticed that changing the owner of a file had no
> > effect. Rebooting with 2.4.18, there was no problem
> > in using chown.
>
> How does this look?

It looks good: with this patch I can now chown and chgrp
as usual.

Thanks for fixing this,

Duncan.

> --- linux-2.5.8-pre3/fs/open.c Tue Apr 9 18:16:40 2002
> +++ 25/fs/open.c Thu Apr 11 00:15:09 2002
> @@ -524,11 +524,11 @@ static int chown_common(struct dentry *
> goto out;
> newattrs.ia_valid = ATTR_CTIME;
> if (user != (uid_t) -1) {
> - newattrs.ia_valid = ATTR_UID;
> + newattrs.ia_valid |= ATTR_UID;
> newattrs.ia_uid = user;
> }
> if (group != (gid_t) -1) {
> - newattrs.ia_valid = ATTR_GID;
> + newattrs.ia_valid |= ATTR_GID;
> newattrs.ia_gid = group;
> }
> if (!S_ISDIR(inode->i_mode))
>
> -