Skip to content

Commit c3fe587

Browse files
Sanidhya Kashyaptorvalds
authored andcommitted
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>
1 parent 8f7d3f0 commit c3fe587

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

‎fs/bfs/dir.c‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ static int bfs_create(struct inode *dir, struct dentry *dentry, umode_t mode,
8686

8787
inode = new_inode(s);
8888
if (!inode)
89-
return -ENOSPC;
89+
return -ENOMEM;
9090
mutex_lock(&info->bfs_lock);
9191
ino = find_first_zero_bit(info->si_imap, info->si_lasti + 1);
9292
if (ino > info->si_lasti) {
@@ -293,7 +293,7 @@ static int bfs_add_entry(struct inode *dir, const unsigned char *name,
293293
for (block = sblock; block <= eblock; block++) {
294294
bh = sb_bread(dir->i_sb, block);
295295
if (!bh)
296-
return -ENOSPC;
296+
return -EIO;
297297
for (off = 0; off < BFS_BSIZE; off += BFS_DIRENT_SIZE) {
298298
de = (struct bfs_dirent *)(bh->b_data + off);
299299
if (!de->ino) {

0 commit comments

Comments
 (0)