* [Cluster-devel] [GFS2 PATCH] GFS2: Get a block reservation before resizing a file [not found] <60871952.18277548.1359737783438.JavaMail.root@redhat.com> @ 2013-02-01 17:03 ` Bob Peterson 2013-02-01 21:13 ` Steven Whitehouse 0 siblings, 1 reply; 2+ messages in thread From: Bob Peterson @ 2013-02-01 17:03 UTC (permalink / raw) To: cluster-devel.redhat.com Hi, This patch allocates a block reservation structure before growing or shrinking a file. Without this structure, the grow or shink code can reference the bad pointer. Regards, Bob Peterson Red Hat File Systems Signed-off-by: Bob Peterson <rpeterso@redhat.com> --- fs/gfs2/bmap.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/fs/gfs2/bmap.c b/fs/gfs2/bmap.c index d29d779..df686d1 100644 --- a/fs/gfs2/bmap.c +++ b/fs/gfs2/bmap.c @@ -1288,6 +1288,10 @@ int gfs2_setattr_size(struct inode *inode, u64 newsize) inode_dio_wait(inode); + ret = gfs2_rs_alloc(GFS2_I(inode)); + if (ret) + return ret; + oldsize = inode->i_size; if (newsize >= oldsize) return do_grow(inode, newsize); ^ permalink raw reply related [flat|nested] 2+ messages in thread
* [Cluster-devel] [GFS2 PATCH] GFS2: Get a block reservation before resizing a file 2013-02-01 17:03 ` [Cluster-devel] [GFS2 PATCH] GFS2: Get a block reservation before resizing a file Bob Peterson @ 2013-02-01 21:13 ` Steven Whitehouse 0 siblings, 0 replies; 2+ messages in thread From: Steven Whitehouse @ 2013-02-01 21:13 UTC (permalink / raw) To: cluster-devel.redhat.com Hi, Now in the -nmw tree. Thanks, Steve. On Fri, 2013-02-01 at 12:03 -0500, Bob Peterson wrote: > Hi, > > This patch allocates a block reservation structure before growing > or shrinking a file. Without this structure, the grow or shink code > can reference the bad pointer. > > Regards, > > Bob Peterson > Red Hat File Systems > > Signed-off-by: Bob Peterson <rpeterso@redhat.com> > --- > fs/gfs2/bmap.c | 4 ++++ > 1 file changed, 4 insertions(+) > > diff --git a/fs/gfs2/bmap.c b/fs/gfs2/bmap.c > index d29d779..df686d1 100644 > --- a/fs/gfs2/bmap.c > +++ b/fs/gfs2/bmap.c > @@ -1288,6 +1288,10 @@ int gfs2_setattr_size(struct inode *inode, u64 newsize) > > inode_dio_wait(inode); > > + ret = gfs2_rs_alloc(GFS2_I(inode)); > + if (ret) > + return ret; > + > oldsize = inode->i_size; > if (newsize >= oldsize) > return do_grow(inode, newsize); > ^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2013-02-01 21:13 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
[not found] <60871952.18277548.1359737783438.JavaMail.root@redhat.com>
2013-02-01 17:03 ` [Cluster-devel] [GFS2 PATCH] GFS2: Get a block reservation before resizing a file Bob Peterson
2013-02-01 21:13 ` Steven Whitehouse
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).