Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 292398
b: refs/heads/master
c: 58a7d5f
h: refs/heads/master
v: v3
  • Loading branch information
Benjamin Marzinski authored and Steven Whitehouse committed Mar 9, 2012
1 parent 1bf89c5 commit 1c2663b
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 6 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 34cc1781c2ae921107e89f6633cfab7436e355ba
refs/heads/master: 58a7d5fb8e31279b992db4027e44b053a84b7344
13 changes: 8 additions & 5 deletions trunk/fs/gfs2/file.c
Original file line number Diff line number Diff line change
Expand Up @@ -676,6 +676,7 @@ static int fallocate_chunk(struct inode *inode, loff_t offset, loff_t len,
struct gfs2_inode *ip = GFS2_I(inode);
struct buffer_head *dibh;
int error;
loff_t size = len;
unsigned int nr_blks;
sector_t lblock = offset >> inode->i_blkbits;

Expand Down Expand Up @@ -709,8 +710,8 @@ static int fallocate_chunk(struct inode *inode, loff_t offset, loff_t len,
goto out;
}
}
if (offset + len > inode->i_size && !(mode & FALLOC_FL_KEEP_SIZE))
i_size_write(inode, offset + len);
if (offset + size > inode->i_size && !(mode & FALLOC_FL_KEEP_SIZE))
i_size_write(inode, offset + size);

mark_inode_dirty(inode);

Expand Down Expand Up @@ -779,12 +780,14 @@ static long gfs2_fallocate(struct file *file, int mode, loff_t offset,
if (unlikely(error))
goto out_uninit;

if (!gfs2_write_alloc_required(ip, offset, len))
goto out_unlock;

while (len > 0) {
if (len < bytes)
bytes = len;
if (!gfs2_write_alloc_required(ip, offset, bytes)) {
len -= bytes;
offset += bytes;
continue;
}
qa = gfs2_qadata_get(ip);
if (!qa) {
error = -ENOMEM;
Expand Down

0 comments on commit 1c2663b

Please sign in to comment.