diff options
-rw-r--r-- | fs/jfs/jfs_extent.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/fs/jfs/jfs_extent.c b/fs/jfs/jfs_extent.c index adaa9ad50d4c..63d21822d309 100644 --- a/fs/jfs/jfs_extent.c +++ b/fs/jfs/jfs_extent.c @@ -311,6 +311,11 @@ extBalloc(struct inode *ip, s64 hint, s64 * nblocks, s64 * blkno) * blocks in the map. in that case, we'll start off with the * maximum free. */ + + /* give up if no space left */ + if (bmp->db_maxfreebud == -1) + return -ENOSPC; + max = (s64) 1 << bmp->db_maxfreebud; if (*nblocks >= max && *nblocks > nbperpage) nb = nblks = (max > nbperpage) ? max : nbperpage; |