From: Steven Whitehouse <swhiteho@redhat.com>
To: linux-kernel@vger.kernel.org, cluster-devel@redhat.com
Cc: Bob Peterson <rpeterso@redhat.com>,
Steven Whitehouse <swhiteho@redhat.com>
Subject: [PATCH 09/10] GFS2: Get a block reservation before resizing a file
Date: Tue, 19 Feb 2013 10:07:39 +0000 [thread overview]
Message-ID: <1361268460-3092-10-git-send-email-swhiteho@redhat.com> (raw)
In-Reply-To: <1361268460-3092-1-git-send-email-swhiteho@redhat.com>
From: Bob Peterson <rpeterso@redhat.com>
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.
Signed-off-by: Bob Peterson <rpeterso@redhat.com>
Signed-off-by: Steven Whitehouse <swhiteho@redhat.com>
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);
--
1.7.4
next prev parent reply other threads:[~2013-02-19 10:34 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-02-19 10:07 GFS2: Pre-pull patch posting (merge window) Steven Whitehouse
2013-02-19 10:07 ` [PATCH 01/10] GFS2: Separate LRU scanning from shrinker Steven Whitehouse
2013-02-19 10:07 ` [PATCH 02/10] GFS2: Merge revoke adding functions Steven Whitehouse
2013-02-19 10:07 ` [PATCH 03/10] GFS2: Split gfs2_trans_add_bh() into two Steven Whitehouse
2013-02-19 10:07 ` [PATCH 04/10] GFS2: Copy gfs2_trans_add_bh into new data/meta functions Steven Whitehouse
2013-02-19 10:07 ` [PATCH 05/10] GFS2: Merge gfs2_attach_bufdata() into trans.c Steven Whitehouse
2013-02-19 10:07 ` [PATCH 06/10] GFS2: Clean up freeze code Steven Whitehouse
2013-02-19 10:07 ` [PATCH 07/10] GFS2: Use ->writepages for ordered writes Steven Whitehouse
2013-02-19 10:07 ` [PATCH 08/10] GFS2: Split glock lru processing into two parts Steven Whitehouse
2013-02-19 10:07 ` Steven Whitehouse [this message]
2013-02-19 10:07 ` [PATCH 10/10] GFS2: Reinstate withdraw ack system Steven Whitehouse
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1361268460-3092-10-git-send-email-swhiteho@redhat.com \
--to=swhiteho@redhat.com \
--cc=cluster-devel@redhat.com \
--cc=linux-kernel@vger.kernel.org \
--cc=rpeterso@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox