summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMaksym Planeta <mcsim.planeta@gmail.com>2012-01-23 23:27:06 +0200
committerSamuel Thibault <samuel.thibault@ens-lyon.org>2012-03-26 23:53:03 +0200
commit4f8d31d72708f4ae08913e7f42fdc4e852597ed3 (patch)
tree8ccd233ad5498ee2d7fa0c03da8c0b57837fdd1e
parent511eff7bf616a313e6fc2397db718a81e93847cc (diff)
Correct available space check.
*tmpfs/node.c (diskfs_grow): Parameter size denotes new size, not delta. So available space check should take that into account.
-rw-r--r--tmpfs/node.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/tmpfs/node.c b/tmpfs/node.c
index ccc077ca..9d3647f8 100644
--- a/tmpfs/node.c
+++ b/tmpfs/node.c
@@ -443,7 +443,8 @@ diskfs_grow (struct node *np, off_t size, struct protid *cred)
return 0;
size = round_page (size);
- if (round_page (tmpfs_space_used + size) / vm_page_size > tmpfs_page_limit)
+ if (round_page (tmpfs_space_used + size - np->allocsize)
+ / vm_page_size > tmpfs_page_limit)
return ENOSPC;
if (default_pager == MACH_PORT_NULL)