Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/rump/librump/rumpvfs When trying to extend a file, don't...
details: https://anonhg.NetBSD.org/src/rev/cd577aab22dd
branches: trunk
changeset: 327760:cd577aab22dd
user: njoly <njoly%NetBSD.org@localhost>
date: Sun Mar 16 10:16:15 2014 +0000
description:
When trying to extend a file, don't wait until the underlying memory
allocation succeed. Return ENOSPC upon failure.
diffstat:
sys/rump/librump/rumpvfs/rumpfs.c | 12 ++++++++----
1 files changed, 8 insertions(+), 4 deletions(-)
diffs (40 lines):
diff -r 72719c482fd8 -r cd577aab22dd sys/rump/librump/rumpvfs/rumpfs.c
--- a/sys/rump/librump/rumpvfs/rumpfs.c Sun Mar 16 10:06:40 2014 +0000
+++ b/sys/rump/librump/rumpvfs/rumpfs.c Sun Mar 16 10:16:15 2014 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: rumpfs.c,v 1.125 2014/02/24 11:43:33 pooka Exp $ */
+/* $NetBSD: rumpfs.c,v 1.126 2014/03/16 10:16:15 njoly Exp $ */
/*
* Copyright (c) 2009, 2010, 2011 Antti Kantee. All Rights Reserved.
@@ -26,7 +26,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: rumpfs.c,v 1.125 2014/02/24 11:43:33 pooka Exp $");
+__KERNEL_RCSID(0, "$NetBSD: rumpfs.c,v 1.126 2014/03/16 10:16:15 njoly Exp $");
#include <sys/param.h>
#include <sys/atomic.h>
@@ -971,7 +971,9 @@
size_t copylen, newlen;
newlen = vap->va_size;
- newdata = rump_hypermalloc(newlen, 0, true, "rumpfs");
+ newdata = rump_hypermalloc(newlen, 0, false, "rumpfs");
+ if (newdata == NULL)
+ return ENOSPC;
copylen = MIN(rn->rn_dlen, newlen);
memset(newdata, 0, newlen);
@@ -1465,7 +1467,9 @@
oldlen = rn->rn_dlen;
olddata = rn->rn_data;
- rn->rn_data = rump_hypermalloc(newlen, 0, true, "rumpfs");
+ rn->rn_data = rump_hypermalloc(newlen, 0, false, "rumpfs");
+ if (rn->rn_data == NULL)
+ return ENOSPC;
rn->rn_dlen = newlen;
memset(rn->rn_data, 0, newlen);
memcpy(rn->rn_data, olddata, oldlen);
Home |
Main Index |
Thread Index |
Old Index