|
@@ -809,7 +809,7 @@ static long __gfs2_fallocate(struct file *file, int mode, loff_t offset, loff_t
|
|
|
struct gfs2_inode *ip = GFS2_I(inode);
|
|
|
struct gfs2_alloc_parms ap = { .aflags = 0, };
|
|
|
unsigned int data_blocks = 0, ind_blocks = 0, rblocks;
|
|
|
- loff_t bytes, max_bytes, max_blks = UINT_MAX;
|
|
|
+ loff_t bytes, max_bytes, max_blks;
|
|
|
int error;
|
|
|
const loff_t pos = offset;
|
|
|
const loff_t count = len;
|
|
@@ -861,7 +861,8 @@ static long __gfs2_fallocate(struct file *file, int mode, loff_t offset, loff_t
|
|
|
return error;
|
|
|
/* ap.allowed tells us how many blocks quota will allow
|
|
|
* us to write. Check if this reduces max_blks */
|
|
|
- if (ap.allowed && ap.allowed < max_blks)
|
|
|
+ max_blks = UINT_MAX;
|
|
|
+ if (ap.allowed)
|
|
|
max_blks = ap.allowed;
|
|
|
|
|
|
error = gfs2_inplace_reserve(ip, &ap);
|