From: Su Yue <glass.su@suse.com>
To: ocfs2-devel@lists.linux.dev
Cc: joseph.qi@linux.alibaba.com, akpm@linux-foundation.org,
Su Yue <glass.su@suse.com>
Subject: [PATCH v3 1/4] ocfs2: return real error code in ocfs2_dio_wr_get_block
Date: Mon, 8 Apr 2024 16:20:38 +0800 [thread overview]
Message-ID: <20240408082041.20925-2-glass.su@suse.com> (raw)
In-Reply-To: <20240408082041.20925-1-glass.su@suse.com>
ocfs2_dio_wr_get_block always returns -EIO in case of errors.
However, some programs expect right exit codes while doing dio.
For example, tools like fio treat -ENOSPC as expected code while
doing stress jobs. And quota tools expect -EDQUOT when disk quota
exceeds.
-EIO is too strong return code in the dio path.
The caller of ocfs2_dio_wr_get_block is __blockdev_direct_IO which is
widely used and it handles error codes well. I have checked functions
called by ocfs2_dio_wr_get_block and their return codes look good and
clear. So I think it's safe to let ocfs2_dio_wr_get_block return real
error code.
Reviewed-by: Joseph Qi <joseph.qi@linux.alibaba.com>
Signed-off-by: Su Yue <glass.su@suse.com>
---
fs/ocfs2/aops.c | 2 --
1 file changed, 2 deletions(-)
diff --git a/fs/ocfs2/aops.c b/fs/ocfs2/aops.c
index b82185075de7..f0467d3b3c88 100644
--- a/fs/ocfs2/aops.c
+++ b/fs/ocfs2/aops.c
@@ -2283,8 +2283,6 @@ static int ocfs2_dio_wr_get_block(struct inode *inode, sector_t iblock,
ocfs2_inode_unlock(inode, 1);
brelse(di_bh);
out:
- if (ret < 0)
- ret = -EIO;
return ret;
}
--
2.44.0
next prev parent reply other threads:[~2024-04-08 8:21 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-04-08 8:20 [PATCH v3 0/4] ocfs2 bugs fixes exposed by fstests Su Yue
2024-04-08 8:20 ` Su Yue [this message]
2024-04-08 8:20 ` [PATCH v3 2/4] ocfs2: fix races between hole punching and AIO+DIO Su Yue
2024-04-08 8:20 ` [PATCH v3 3/4] ocfs2: update inode fsync transaction id in ocfs2_unlink and ocfs2_link Su Yue
2024-04-08 8:20 ` [PATCH v3 4/4] ocfs2: use coarse time for new created files Su Yue
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=20240408082041.20925-2-glass.su@suse.com \
--to=glass.su@suse.com \
--cc=akpm@linux-foundation.org \
--cc=joseph.qi@linux.alibaba.com \
--cc=ocfs2-devel@lists.linux.dev \
/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;
as well as URLs for NNTP newsgroup(s).