Index: uspace/srv/fs/fat/fat_fat.c
===================================================================
--- uspace/srv/fs/fat/fat_fat.c	(revision c91f2d1b74337f64f6bb816a3391eb3b801b5031)
+++ uspace/srv/fs/fat/fat_fat.c	(revision 684b6555b34924d5acac46dd80885b86adfe4faa)
@@ -114,4 +114,5 @@
 /** Read block from file located on a FAT file system.
  *
+ * @param block		Pointer to a block pointer for storing result.
  * @param bs		Buffer holding the boot sector of the file system.
  * @param dev_handle	Device handle of the file system.
@@ -121,11 +122,10 @@
  * @param flags		Flags passed to libblock.
  *
- * @return		Block structure holding the requested block.
- */
-block_t *
-_fat_block_get(fat_bs_t *bs, dev_handle_t dev_handle, fat_cluster_t firstc,
-    bn_t bn, int flags)
-{
-	block_t *b;
+ * @return		EOK on success or a negative error code.
+ */
+int
+_fat_block_get(block_t **block, fat_bs_t *bs, dev_handle_t dev_handle,
+    fat_cluster_t firstc, bn_t bn, int flags)
+{
 	unsigned bps;
 	unsigned rscnt;		/* block address of the first FAT */
@@ -150,8 +150,7 @@
 		/* root directory special case */
 		assert(bn < rds);
-		rc = block_get(&b, dev_handle, rscnt + bs->fatcnt * sf + bn,
+		rc = block_get(block, dev_handle, rscnt + bs->fatcnt * sf + bn,
 		    flags);
-		assert(rc == EOK);
-		return b;
+		return rc;
 	}
 
@@ -161,9 +160,8 @@
 	assert(clusters == max_clusters);
 
-	rc = block_get(&b, dev_handle, ssa +
-	    (lastc - FAT_CLST_FIRST) * bs->spc + bn % bs->spc, flags);
-	assert(rc == EOK);
-
-	return b;
+	rc = block_get(block, dev_handle,
+	    ssa + (lastc - FAT_CLST_FIRST) * bs->spc + bn % bs->spc, flags);
+
+	return rc;
 }
 
@@ -196,5 +194,6 @@
 	    	int flags = (o % bps == 0) ?
 		    BLOCK_FLAGS_NOREAD : BLOCK_FLAGS_NONE;
-		b = fat_block_get(bs, nodep, o / bps, flags);
+		rc = fat_block_get(&b, bs, nodep, o / bps, flags);
+		assert(rc == EOK);
 		memset(b->data + o % bps, 0, bps - o % bps);
 		b->dirty = true;		/* need to sync node */
@@ -208,6 +207,7 @@
 	/* zero out the initial part of the new cluster chain */
 	for (o = boundary; o < pos; o += bps) {
-		b = _fat_block_get(bs, nodep->idx->dev_handle, mcl,
+		rc = _fat_block_get(&b, bs, nodep->idx->dev_handle, mcl,
 		    (o - boundary) / bps, BLOCK_FLAGS_NOREAD);
+		assert(rc == EOK);
 		memset(b->data, 0, min(bps, pos - o));
 		b->dirty = true;		/* need to sync node */
@@ -481,5 +481,7 @@
 	
 	for (i = 0; i < bs->spc; i++) {
-		b = _fat_block_get(bs, dev_handle, c, i, BLOCK_FLAGS_NOREAD);
+		rc = _fat_block_get(&b, bs, dev_handle, c, i,
+		    BLOCK_FLAGS_NOREAD);
+		assert(rc == EOK);
 		memset(b->data, 0, bps);
 		b->dirty = true;
Index: uspace/srv/fs/fat/fat_fat.h
===================================================================
--- uspace/srv/fs/fat/fat_fat.h	(revision c91f2d1b74337f64f6bb816a3391eb3b801b5031)
+++ uspace/srv/fs/fat/fat_fat.h	(revision 684b6555b34924d5acac46dd80885b86adfe4faa)
@@ -64,8 +64,9 @@
     fat_cluster_t *, uint16_t);
 
-#define fat_block_get(bs, np, bn, flags) \
-    _fat_block_get((bs), (np)->idx->dev_handle, (np)->firstc, (bn), (flags))
+#define fat_block_get(b, bs, np, bn, flags) \
+    _fat_block_get((b), (bs), (np)->idx->dev_handle, (np)->firstc, (bn), \
+    (flags))
 
-extern struct block *_fat_block_get(struct fat_bs *, dev_handle_t,
+extern int _fat_block_get(block_t **, struct fat_bs *, dev_handle_t,
     fat_cluster_t, bn_t, int);
   
Index: uspace/srv/fs/fat/fat_ops.c
===================================================================
--- uspace/srv/fs/fat/fat_ops.c	(revision c91f2d1b74337f64f6bb816a3391eb3b801b5031)
+++ uspace/srv/fs/fat/fat_ops.c	(revision 684b6555b34924d5acac46dd80885b86adfe4faa)
@@ -94,6 +94,7 @@
 	
 	/* Read the block that contains the dentry of interest. */
-	b = _fat_block_get(bs, node->idx->dev_handle, node->idx->pfc,
+	rc = _fat_block_get(&b, bs, node->idx->dev_handle, node->idx->pfc,
 	    (node->idx->pdi * sizeof(fat_dentry_t)) / bps, BLOCK_FLAGS_NONE);
+	assert(rc == EOK);
 
 	d = ((fat_dentry_t *)b->data) + (node->idx->pdi % dps);
@@ -202,7 +203,7 @@
 
 	/* Read the block that contains the dentry of interest. */
-	b = _fat_block_get(bs, idxp->dev_handle, idxp->pfc,
+	rc = _fat_block_get(&b, bs, idxp->dev_handle, idxp->pfc,
 	    (idxp->pdi * sizeof(fat_dentry_t)) / bps, BLOCK_FLAGS_NONE);
-	assert(b);
+	assert(rc == EOK);
 
 	d = ((fat_dentry_t *)b->data) + (idxp->pdi % dps);
@@ -433,5 +434,6 @@
 
 	for (i = 0; i < blocks; i++) {
-		b = fat_block_get(bs, parentp, i, BLOCK_FLAGS_NONE);
+		rc = fat_block_get(&b, bs, parentp, i, BLOCK_FLAGS_NONE);
+		assert(rc == EOK);
 		for (j = 0; j < dps; j++) {
 			d = ((fat_dentry_t *)b->data) + j;
@@ -469,5 +471,6 @@
 	parentp->size += bps * bs->spc;
 	parentp->dirty = true;		/* need to sync node */
-	b = fat_block_get(bs, parentp, i, BLOCK_FLAGS_NONE);
+	rc = fat_block_get(&b, bs, parentp, i, BLOCK_FLAGS_NONE);
+	assert(rc == EOK);
 	d = (fat_dentry_t *)b->data;
 
@@ -494,5 +497,6 @@
 	 * not use them anyway, so this is rather a sign of our good will.
 	 */
-	b = fat_block_get(bs, childp, 0, BLOCK_FLAGS_NONE);
+	rc = fat_block_get(&b, bs, childp, 0, BLOCK_FLAGS_NONE);
+	assert(rc == EOK);
 	d = (fat_dentry_t *)b->data;
 	if (fat_classify_dentry(d) == FAT_DENTRY_LAST ||
@@ -561,7 +565,8 @@
 	bps = uint16_t_le2host(bs->bps);
 
-	b = _fat_block_get(bs, childp->idx->dev_handle, childp->idx->pfc,
+	rc = _fat_block_get(&b, bs, childp->idx->dev_handle, childp->idx->pfc,
 	    (childp->idx->pdi * sizeof(fat_dentry_t)) / bps,
 	    BLOCK_FLAGS_NONE);
+	assert(rc == EOK);
 	d = (fat_dentry_t *)b->data +
 	    (childp->idx->pdi % (bps / sizeof(fat_dentry_t)));
@@ -605,5 +610,6 @@
 	blocks = parentp->size / bps;
 	for (i = 0; i < blocks; i++) {
-		b = fat_block_get(bs, parentp, i, BLOCK_FLAGS_NONE);
+		rc = fat_block_get(&b, bs, parentp, i, BLOCK_FLAGS_NONE);
+		assert(rc == EOK);
 		for (j = 0; j < dps; j++) { 
 			d = ((fat_dentry_t *)b->data) + j;
@@ -698,5 +704,6 @@
 		fat_dentry_t *d;
 	
-		b = fat_block_get(bs, nodep, i, BLOCK_FLAGS_NONE);
+		rc = fat_block_get(&b, bs, nodep, i, BLOCK_FLAGS_NONE);
+		assert(rc == EOK);
 		for (j = 0; j < dps; j++) {
 			d = ((fat_dentry_t *)b->data) + j;
@@ -953,6 +960,7 @@
 			bytes = min(len, bps - pos % bps);
 			bytes = min(bytes, nodep->size - pos);
-			b = fat_block_get(bs, nodep, pos / bps,
+			rc = fat_block_get(&b, bs, nodep, pos / bps,
 			    BLOCK_FLAGS_NONE);
+			assert(rc == EOK);
 			(void) ipc_data_read_finalize(callid, b->data + pos % bps,
 			    bytes);
@@ -980,5 +988,7 @@
 			off_t o;
 
-			b = fat_block_get(bs, nodep, bnum, BLOCK_FLAGS_NONE);
+			rc = fat_block_get(&b, bs, nodep, bnum,
+			    BLOCK_FLAGS_NONE);
+			assert(rc == EOK);
 			for (o = pos % (bps / sizeof(fat_dentry_t));
 			    o < bps / sizeof(fat_dentry_t);
@@ -1076,5 +1086,6 @@
 		 */
 		fat_fill_gap(bs, nodep, FAT_CLST_RES0, pos);
-		b = fat_block_get(bs, nodep, pos / bps, flags);
+		rc = fat_block_get(&b, bs, nodep, pos / bps, flags);
+		assert(rc == EOK);
 		(void) ipc_data_write_finalize(callid, b->data + pos % bps,
 		    bytes);
@@ -1110,6 +1121,7 @@
 		/* zero fill any gaps */
 		fat_fill_gap(bs, nodep, mcl, pos);
-		b = _fat_block_get(bs, dev_handle, lcl, (pos / bps) % spc,
+		rc = _fat_block_get(&b, bs, dev_handle, lcl, (pos / bps) % spc,
 		    flags);
+		assert(rc == EOK);
 		(void) ipc_data_write_finalize(callid, b->data + pos % bps,
 		    bytes);
