[PATCH 06/11] fs: ramfs: Return -ENOSPC

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



When ramfs fails to allocate more memory then returning -ENOSPC is
more appropriate then -ENOMEM.

Signed-off-by: Sascha Hauer <s.hauer@xxxxxxxxxxxxxx>
---
 fs/ramfs.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/fs/ramfs.c b/fs/ramfs.c
index 341b6130de..800b03af29 100644
--- a/fs/ramfs.c
+++ b/fs/ramfs.c
@@ -367,7 +367,7 @@ static int ramfs_truncate(struct device_d *dev, FILE *f, loff_t size)
 		} else {
 			node->data = ramfs_get_chunk();
 			if (!node->data)
-				return -ENOMEM;
+				return -ENOSPC;
 			data = node->data;
 			oldchunks = 1;
 		}
@@ -378,7 +378,7 @@ static int ramfs_truncate(struct device_d *dev, FILE *f, loff_t size)
 		while (newchunks > oldchunks) {
 			data->next = ramfs_get_chunk();
 			if (!data->next)
-				return -ENOMEM;
+				return -ENOSPC;
 			data = data->next;
 			oldchunks++;
 		}
-- 
2.27.0


_______________________________________________
barebox mailing list
barebox@xxxxxxxxxxxxxxxxxxx
http://lists.infradead.org/mailman/listinfo/barebox



[Index of Archives]     [Linux Embedded]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [XFree86]

  Powered by Linux