summaryrefslogtreecommitdiff
path: root/fs/gfs2/file.c
diff options
context:
space:
mode:
authorAndrew Price <anprice@redhat.com>2017-04-05 18:45:26 +0300
committerBob Peterson <rpeterso@redhat.com>2017-04-05 18:45:26 +0300
commitd4d7fc12b642a16732adeacefdaebe684bcb2218 (patch)
tree29f04bad0806d11aff8b0eadf327f34c22e633a6 /fs/gfs2/file.c
parentd4da31986c5da14277b3ecc479f1b0682756b54c (diff)
downloadlinux-d4d7fc12b642a16732adeacefdaebe684bcb2218.tar.xz
gfs2: Re-enable fallocate for the rindex
Commit 86066914edff2316cbed63aac8a87d5001441a16 "gfs2: Don't support fallocate on jdata files" removed the ability of gfs2_grow to reserve space at the end of the rindex, which could prevent a second gfs2_grow from succeeding if the fs is full. Allow fallocate to work on the rindex once again. Signed-off-by: Andrew Price <anprice@redhat.com> Signed-off-by: Bob Peterson <rpeterso@redhat.com>
Diffstat (limited to 'fs/gfs2/file.c')
-rw-r--r--fs/gfs2/file.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/fs/gfs2/file.c b/fs/gfs2/file.c
index 6fe2a59c6a9a..c2062a108d19 100644
--- a/fs/gfs2/file.c
+++ b/fs/gfs2/file.c
@@ -911,11 +911,15 @@ out_qunlock:
static long gfs2_fallocate(struct file *file, int mode, loff_t offset, loff_t len)
{
struct inode *inode = file_inode(file);
+ struct gfs2_sbd *sdp = GFS2_SB(inode);
struct gfs2_inode *ip = GFS2_I(inode);
struct gfs2_holder gh;
int ret;
- if ((mode & ~FALLOC_FL_KEEP_SIZE) || gfs2_is_jdata(ip))
+ if (mode & ~FALLOC_FL_KEEP_SIZE)
+ return -EOPNOTSUPP;
+ /* fallocate is needed by gfs2_grow to reserve space in the rindex */
+ if (gfs2_is_jdata(ip) && inode != sdp->sd_rindex)
return -EOPNOTSUPP;
inode_lock(inode);