Skip to contentSkip to conversation

remove inode_setattr

DISCUSSION Stephen Rothwell 3 participants 5 messages Aug 11, 2010 3 messages not in the archive

Subsystems (2)
lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): [email protected]

A message that is not in the archive (sent off-list or not yet received): [email protected]

A message that is not in the archive (sent off-list or not yet received): [email protected]

#3 lore raw

Hi All,

Quoted 3 lines · On Wed, 11 Aug 2010 10:17:51 +1000 Stephen Rothwell <[email protected]>…

Reported by me June 22 with a fixup, reminded Aug 4 and yesterday ... it needed to be fixed up by Linus when he merged Al's tree ...

I will apply this fix patch to linux-next today ... Al, Christoph, this is the fix I sent out earlier. Is it correct enough for Linus to apply it?

From: Stephen Rothwell <[email protected]>
Date: Tue, 22 Jun 2010 11:15:01 +1000
Subject: [PATCH] v9fs: fixup for inode_setattr being removed

---
 fs/9p/vfs_inode.c |   15 ++++++++++++---
 1 files changed, 12 insertions(+), 3 deletions(-)
fs/9p/vfs_inode.c +12 -3
index f027a42..2ec7bfa 100644
@@ -1052,10 +1052,19 @@ static int v9fs_vfs_setattr_dotl(struct dentry *dentry, struct iattr *iattr)
 		return PTR_ERR(fid);
 
 	retval = p9_client_setattr(fid, &p9attr);
-	if (retval >= 0)
-		retval = inode_setattr(dentry->d_inode, iattr);
+	if (retval < 0)
+		return retval;
 
-	return retval;
+	if ((iattr->ia_valid & ATTR_SIZE) &&
+	    iattr->ia_size != i_size_read(dentry->d_inode)) {
+		retval = vmtruncate(dentry->d_inode, iattr->ia_size);
+		if (retval)
+			return retval;
+	}
+
+	setattr_copy(dentry->d_inode, iattr);
+	mark_inode_dirty(dentry->d_inode);
+	return 0;
 }
 
 /**
Signature · 6 lines
1.7.1

-- 
Cheers,
Stephen Rothwell                    [email protected]
http://www.canb.auug.org.au/~sfr/
#4 lore raw
Quoted 35 lines · Stephen Rothwell

Hi All,

Quoted 3 lines · On Wed, 11 Aug 2010 10:17:51 +1000 Stephen Rothwell <[email protected]>…

Reported by me June 22 with a fixup, reminded Aug 4 and yesterday ... it needed to be fixed up by Linus when he merged Al's tree ...

I will apply this fix patch to linux-next today ... Al, Christoph, this is the fix I sent out earlier. Is it correct enough for Linus to apply it?

From: Stephen Rothwell <[email protected]>
Date: Tue, 22 Jun 2010 11:15:01 +1000
Subject: [PATCH] v9fs: fixup for inode_setattr being removed

---
 fs/9p/vfs_inode.c |   15 ++++++++++++---
 1 files changed, 12 insertions(+), 3 deletions(-)
fs/9p/vfs_inode.c +3 -3
index f027a42..2ec7bfa 100644
@@ -1052,10 +1052,19 @@ static int v9fs_vfs_setattr_dotl(struct dentry *dentry, struct iattr *iattr)
 		return PTR_ERR(fid);
 
 	retval = p9_client_setattr(fid, &p9attr);
-	if (retval >= 0)
-		retval = inode_setattr(dentry->d_inode, iattr);
+	if (retval < 0)
+		return retval;
 
-	return retval;
+	if ((iattr->ia_valid & ATTR_SIZE) &&

fs/9p/vfs_inode.c static int v9fs_vfs_setattr_dotl(struct dentry *dentry, struct iattr *iattr) · line 1068

Quoted 10 lines
fs/9p/vfs_inode.c +9 -0
+	    iattr->ia_size != i_size_read(dentry->d_inode)) {
+		retval = vmtruncate(dentry->d_inode, iattr->ia_size);
+		if (retval)
+			return retval;
+	}
+
+	setattr_copy(dentry->d_inode, iattr);
+	mark_inode_dirty(dentry->d_inode);
+	return 0;
 }

Whiskey Tango Fotrot, Over

In Linus' tree we have
commit 1025774ce411f2bd4b059ad7b53f0003569b74fa

Author: Christoph Hellwig <[email protected]>
Date:   Fri Jun 4 11:30:02 2010 +0200

...

fs/9p/vfs_inode.c +9 -2
index 4331b3b..4b3ad6a 100644
@@ -896,10 +896,19 @@ static int v9fs_vfs_setattr(struct dentry *dentry, struct 
        }
 
        retval = p9_client_wstat(fid, &wstat);
-       if (retval >= 0)
-               retval = inode_setattr(dentry->d_inode, iattr);
+       if (retval < 0)
+               return retval;
+
+       if ((iattr->ia_valid & ATTR_SIZE) &&
+           iattr->ia_size != i_size_read(dentry->d_inode)) {
+               retval = vmtruncate(dentry->d_inode, iattr->ia_size);
+               if (retval)
+                       return retval;
+       }
 

So what the hell is going on?

#5 lore raw
Quoted 27 lines · On Wed, 11 Aug 2010 01:52:16 +0100 Al Viro <[email protected]> wrote:

Whiskey Tango Fotrot, Over

In Linus' tree we have
commit 1025774ce411f2bd4b059ad7b53f0003569b74fa

Author: Christoph Hellwig <[email protected]>
Date:   Fri Jun 4 11:30:02 2010 +0200

...

fs/9p/vfs_inode.c +9 -2
index 4331b3b..4b3ad6a 100644
@@ -896,10 +896,19 @@ static int v9fs_vfs_setattr(struct dentry *dentry, struct 
        }
 
        retval = p9_client_wstat(fid, &wstat);
-       if (retval >= 0)
-               retval = inode_setattr(dentry->d_inode, iattr);
+       if (retval < 0)
+               return retval;
+
+       if ((iattr->ia_valid & ATTR_SIZE) &&
+           iattr->ia_size != i_size_read(dentry->d_inode)) {
+               retval = vmtruncate(dentry->d_inode, iattr->ia_size);
+               if (retval)
+                       return retval;
+       }
 
Quoted 1 line

So what the hell is going on?

That's v9fs_vfs_setattr(). The problem is in the new v9fs_vfs_setattr_dotl().

#6 lore raw
Quoted 2 lines · Andrew Morton

That's v9fs_vfs_setattr(). The problem is in the new v9fs_vfs_setattr_dotl().

Yeah, see another posting... Fix is in the queue I'm putting together for tonight. Sorry about that...

#7 lore raw
In reply to Al Viro

fs/9p/vfs_inode.c static int v9fs_vfs_setattr(struct dentry *dentry, struct

Quoted 24 lines · Al Viro
Quoted 10 lines · Stephen Rothwell

Hi All,

Quoted 3 lines · On Wed, 11 Aug 2010 10:17:51 +1000 Stephen Rothwell <[email protected]>…

Reported by me June 22 with a fixup, reminded Aug 4 and yesterday ... it needed to be fixed up by Linus when he merged Al's tree ...

I will apply this fix patch to linux-next today ... Al, Christoph, this is the fix I sent out earlier. Is it correct enough for Linus to apply it?

Whiskey Tango Fotrot, Over

In Linus' tree we have
commit 1025774ce411f2bd4b059ad7b53f0003569b74fa

Author: Christoph Hellwig <[email protected]>
Date:   Fri Jun 4 11:30:02 2010 +0200

...

fs/9p/vfs_inode.c +0 -0
index 4331b3b..4b3ad6a 100644
@@ -896,10 +896,19 @@ static int v9fs_vfs_setattr(struct dentry *dentry, struct 

D'oh. Different function, appeared there only recently. OK, I'll drop your fix into today's pull request (in about an hour). ACK.