* Re: remove inode_setattr
[not found] ` <20100811101751.1afdded8.sfr@canb.auug.org.au>
@ 2010-08-11 0:45 ` Stephen Rothwell
2010-08-11 0:52 ` Al Viro
0 siblings, 1 reply; 5+ messages in thread
From: Stephen Rothwell @ 2010-08-11 0:45 UTC (permalink / raw)
To: Andrew Morton
Cc: Al Viro, Christoph Hellwig, Linus Torvalds, Eric Van Hensbergen,
Sripathi Kodi, LKML, linux-next
Hi All,
On Wed, 11 Aug 2010 10:17:51 +1000 Stephen Rothwell <sfr@canb.auug.org.au> wrote:
>
> 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 <sfr@canb.auug.org.au>
Date: Tue, 22 Jun 2010 11:15:01 +1000
Subject: [PATCH] v9fs: fixup for inode_setattr being removed
Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au>
---
fs/9p/vfs_inode.c | 15 ++++++++++++---
1 files changed, 12 insertions(+), 3 deletions(-)
diff --git a/fs/9p/vfs_inode.c b/fs/9p/vfs_inode.c
index f027a42..2ec7bfa 100644
--- a/fs/9p/vfs_inode.c
+++ b/fs/9p/vfs_inode.c
@@ -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;
}
/**
--
1.7.1
--
Cheers,
Stephen Rothwell sfr@canb.auug.org.au
http://www.canb.auug.org.au/~sfr/
^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: remove inode_setattr
2010-08-11 0:45 ` remove inode_setattr Stephen Rothwell
@ 2010-08-11 0:52 ` Al Viro
2010-08-11 0:59 ` Andrew Morton
2010-08-11 1:00 ` Al Viro
0 siblings, 2 replies; 5+ messages in thread
From: Al Viro @ 2010-08-11 0:52 UTC (permalink / raw)
To: Stephen Rothwell
Cc: Andrew Morton, Christoph Hellwig, Linus Torvalds,
Eric Van Hensbergen, Sripathi Kodi, LKML, linux-next
On Wed, Aug 11, 2010 at 10:45:03AM +1000, Stephen Rothwell wrote:
> Hi All,
>
> On Wed, 11 Aug 2010 10:17:51 +1000 Stephen Rothwell <sfr@canb.auug.org.au> wrote:
> >
> > 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 <sfr@canb.auug.org.au>
> Date: Tue, 22 Jun 2010 11:15:01 +1000
> Subject: [PATCH] v9fs: fixup for inode_setattr being removed
>
> Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au>
> ---
> fs/9p/vfs_inode.c | 15 ++++++++++++---
> 1 files changed, 12 insertions(+), 3 deletions(-)
>
> diff --git a/fs/9p/vfs_inode.c b/fs/9p/vfs_inode.c
> index f027a42..2ec7bfa 100644
> --- a/fs/9p/vfs_inode.c
> +++ b/fs/9p/vfs_inode.c
> @@ -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;
> }
Whiskey Tango Fotrot, Over
In Linus' tree we have
commit 1025774ce411f2bd4b059ad7b53f0003569b74fa
Author: Christoph Hellwig <hch@lst.de>
Date: Fri Jun 4 11:30:02 2010 +0200
...
diff --git a/fs/9p/vfs_inode.c b/fs/9p/vfs_inode.c
index 4331b3b..4b3ad6a 100644
--- a/fs/9p/vfs_inode.c
+++ b/fs/9p/vfs_inode.c
@@ -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?
^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: remove inode_setattr
2010-08-11 0:52 ` Al Viro
@ 2010-08-11 0:59 ` Andrew Morton
2010-08-11 1:01 ` Al Viro
2010-08-11 1:00 ` Al Viro
1 sibling, 1 reply; 5+ messages in thread
From: Andrew Morton @ 2010-08-11 0:59 UTC (permalink / raw)
To: Al Viro
Cc: Stephen Rothwell, Christoph Hellwig, Linus Torvalds,
Eric Van Hensbergen, Sripathi Kodi, LKML, linux-next
On Wed, 11 Aug 2010 01:52:16 +0100
Al Viro <viro@ZenIV.linux.org.uk> wrote:
> Whiskey Tango Fotrot, Over
>
> In Linus' tree we have
> commit 1025774ce411f2bd4b059ad7b53f0003569b74fa
> Author: Christoph Hellwig <hch@lst.de>
> Date: Fri Jun 4 11:30:02 2010 +0200
> ...
> diff --git a/fs/9p/vfs_inode.c b/fs/9p/vfs_inode.c
> index 4331b3b..4b3ad6a 100644
> --- a/fs/9p/vfs_inode.c
> +++ b/fs/9p/vfs_inode.c
> @@ -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?
That's v9fs_vfs_setattr(). The problem is in the new
v9fs_vfs_setattr_dotl().
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: remove inode_setattr
2010-08-11 0:52 ` Al Viro
2010-08-11 0:59 ` Andrew Morton
@ 2010-08-11 1:00 ` Al Viro
1 sibling, 0 replies; 5+ messages in thread
From: Al Viro @ 2010-08-11 1:00 UTC (permalink / raw)
To: Stephen Rothwell
Cc: Andrew Morton, Christoph Hellwig, Linus Torvalds,
Eric Van Hensbergen, Sripathi Kodi, LKML, linux-next
On Wed, Aug 11, 2010 at 01:52:16AM +0100, Al Viro wrote:
> On Wed, Aug 11, 2010 at 10:45:03AM +1000, Stephen Rothwell wrote:
> > Hi All,
> >
> > On Wed, 11 Aug 2010 10:17:51 +1000 Stephen Rothwell <sfr@canb.auug.org.au> wrote:
> > >
> > > 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 <hch@lst.de>
> Date: Fri Jun 4 11:30:02 2010 +0200
> ...
> diff --git a/fs/9p/vfs_inode.c b/fs/9p/vfs_inode.c
> index 4331b3b..4b3ad6a 100644
> --- a/fs/9p/vfs_inode.c
> +++ b/fs/9p/vfs_inode.c
> @@ -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.
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: remove inode_setattr
2010-08-11 0:59 ` Andrew Morton
@ 2010-08-11 1:01 ` Al Viro
0 siblings, 0 replies; 5+ messages in thread
From: Al Viro @ 2010-08-11 1:01 UTC (permalink / raw)
To: Andrew Morton
Cc: Stephen Rothwell, Christoph Hellwig, Linus Torvalds,
Eric Van Hensbergen, Sripathi Kodi, LKML, linux-next
On Tue, Aug 10, 2010 at 05:59:44PM -0700, Andrew Morton wrote:
> 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...
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2010-08-11 1:01 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
[not found] <201008101859.o7AIx9BM026915@hera.kernel.org>
[not found] ` <20100810155011.b9657102.akpm@linux-foundation.org>
[not found] ` <20100811101751.1afdded8.sfr@canb.auug.org.au>
2010-08-11 0:45 ` remove inode_setattr Stephen Rothwell
2010-08-11 0:52 ` Al Viro
2010-08-11 0:59 ` Andrew Morton
2010-08-11 1:01 ` Al Viro
2010-08-11 1:00 ` Al Viro
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).