diff options
author | Sanidhya Kashyap <sanidhya.gatech@gmail.com> | 2015-04-16 21:48:32 +0200 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2015-04-17 15:04:09 +0200 |
commit | c3fe5872eb3f5f9e027d61d8a3f5d092168fdbca (patch) | |
tree | 2d15193ba9e3d329e58f5c3b38c89dd0930b68e2 /fs/bfs | |
parent | bfs: bfad_worker cleanup (diff) | |
download | linux-c3fe5872eb3f5f9e027d61d8a3f5d092168fdbca.tar.xz linux-c3fe5872eb3f5f9e027d61d8a3f5d092168fdbca.zip |
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>
Diffstat (limited to 'fs/bfs')
-rw-r--r-- | fs/bfs/dir.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/fs/bfs/dir.c b/fs/bfs/dir.c index 08063ae0a17c..7a8182770649 100644 --- a/fs/bfs/dir.c +++ b/fs/bfs/dir.c @@ -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) { |