Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

bfs: correct return values

In case of failed memory allocation, the return should be ENOMEM instead
of ENOSPC.

Return -EIO when sb_bread() fails.

Signed-off-by: Sanidhya Kashyap <sanidhya.gatech@gmail.com>
Cc: Tigran Aivazian <tigran@aivazian.fsnet.co.uk>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>

authored by

Sanidhya Kashyap and committed by
Linus Torvalds
c3fe5872 8f7d3f0f

+2 -2
+2 -2
fs/bfs/dir.c
··· 86 86 87 87 inode = new_inode(s); 88 88 if (!inode) 89 - return -ENOSPC; 89 + return -ENOMEM; 90 90 mutex_lock(&info->bfs_lock); 91 91 ino = find_first_zero_bit(info->si_imap, info->si_lasti + 1); 92 92 if (ino > info->si_lasti) { ··· 293 293 for (block = sblock; block <= eblock; block++) { 294 294 bh = sb_bread(dir->i_sb, block); 295 295 if (!bh) 296 - return -ENOSPC; 296 + return -EIO; 297 297 for (off = 0; off < BFS_BSIZE; off += BFS_DIRENT_SIZE) { 298 298 de = (struct bfs_dirent *)(bh->b_data + off); 299 299 if (!de->ino) {