mirror of
https://github.com/torvalds/linux.git
synced 2024-11-21 19:41:42 +00:00
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>
This commit is contained in:
parent
8f7d3f0f1e
commit
c3fe5872eb
@ -86,7 +86,7 @@ static int bfs_create(struct inode *dir, struct dentry *dentry, umode_t mode,
|
||||
|
||||
inode = new_inode(s);
|
||||
if (!inode)
|
||||
return -ENOSPC;
|
||||
return -ENOMEM;
|
||||
mutex_lock(&info->bfs_lock);
|
||||
ino = find_first_zero_bit(info->si_imap, info->si_lasti + 1);
|
||||
if (ino > info->si_lasti) {
|
||||
@ -293,7 +293,7 @@ static int bfs_add_entry(struct inode *dir, const unsigned char *name,
|
||||
for (block = sblock; block <= eblock; block++) {
|
||||
bh = sb_bread(dir->i_sb, block);
|
||||
if (!bh)
|
||||
return -ENOSPC;
|
||||
return -EIO;
|
||||
for (off = 0; off < BFS_BSIZE; off += BFS_DIRENT_SIZE) {
|
||||
de = (struct bfs_dirent *)(bh->b_data + off);
|
||||
if (!de->ino) {
|
||||
|
Loading…
Reference in New Issue
Block a user