ldiskfs_journal_ensure_credits() could possibly return 1 if
transaction restarted, Lustre osd expect it return 0 or negative.
Fixes:
cf48a2d23b ("LU-13839 kernel: RHEL 8.3 server support")
Signed-off-by: Wang Shilong <wshilong@ddn.com>
Change-Id: I51ff0bd50575902b66529cbd71ff14710c202d03
Reviewed-on: https://review.whamcloud.com/40989
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Tested-by: jenkins <devops@whamcloud.com>
Reviewed-by: Jian Yu <yujian@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
static int osd_extend_restart_trans(handle_t *handle, int needed,
struct inode *inode)
{
static int osd_extend_restart_trans(handle_t *handle, int needed,
struct inode *inode)
{
- return ldiskfs_journal_ensure_credits(handle, needed,
+ int rc;
+
+ rc = ldiskfs_journal_ensure_credits(handle, needed,
ldiskfs_trans_default_revoke_credits(inode->i_sb));
ldiskfs_trans_default_revoke_credits(inode->i_sb));
+ /* this means journal has been restarted */
+ if (rc > 0)
+ rc = 0;
+
+ return rc;
}
#else
static int osd_extend_trans(handle_t *handle, int needed,
}
#else
static int osd_extend_trans(handle_t *handle, int needed,