From: Sanidhya Kashyap <sanidhya.gatech@gmail.com>
To: tigran@aivazian.fsnet.co.uk, linux-kernel@vger.kernel.org
Cc: taesoo@gatech.edu, changwoo@gatech.edu, sanidhya@gatech.edu,
blee@gatech.edu, csong84@gatech.edu,
Sanidhya Kashyap <sanidhya.gatech@gmail.com>
Subject: [PATCH] bfs: correct return values
Date: Tue, 24 Mar 2015 19:10:57 -0400 [thread overview]
Message-ID: <1427238657-9740-1-git-send-email-sanidhya.gatech@gmail.com> (raw)
In case of no memory allocation, the return should be
ENOMEM instead of ENOSPC. Well, for the other case, in which
the buffer head is not allocated, in that case -EIO should
be returned.
Signed-off-by: Sanidhya Kashyap <sanidhya.gatech@gmail.com>
---
fs/bfs/dir.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/fs/bfs/dir.c b/fs/bfs/dir.c
index 08063ae..7a818277 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) {
--
2.1.0
reply other threads:[~2015-03-24 23:11 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1427238657-9740-1-git-send-email-sanidhya.gatech@gmail.com \
--to=sanidhya.gatech@gmail.com \
--cc=blee@gatech.edu \
--cc=changwoo@gatech.edu \
--cc=csong84@gatech.edu \
--cc=linux-kernel@vger.kernel.org \
--cc=sanidhya@gatech.edu \
--cc=taesoo@gatech.edu \
--cc=tigran@aivazian.fsnet.co.uk \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Powered by JetHome