diff options
author | Dave Chinner <dchinner@redhat.com> | 2022-07-07 14:05:18 +0200 |
---|---|---|
committer | Dave Chinner <david@fromorbit.com> | 2022-07-07 14:05:18 +0200 |
commit | 85c73bf726e41be276bcad3325d9a8aef10be289 (patch) | |
tree | 1cd74ee0a59eeb2fb856fd40387bec20ef553adf /fs/xfs/xfs_qm.c | |
parent | xfs: prevent a UAF when log IO errors race with unmount (diff) | |
download | linux-85c73bf726e41be276bcad3325d9a8aef10be289.tar.xz linux-85c73bf726e41be276bcad3325d9a8aef10be289.zip |
xfs: rework xfs_buf_incore() API
Make it consistent with the other buffer APIs to return a error and
the buffer is placed in a parameter.
Signed-off-by: Dave Chinner <dchinner@redhat.com>
Reviewed-by: Darrick J. Wong <djwong@kernel.org>
Diffstat (limited to 'fs/xfs/xfs_qm.c')
-rw-r--r-- | fs/xfs/xfs_qm.c | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/fs/xfs/xfs_qm.c b/fs/xfs/xfs_qm.c index abf08bbf34a9..3517a6be8dad 100644 --- a/fs/xfs/xfs_qm.c +++ b/fs/xfs/xfs_qm.c @@ -1229,12 +1229,11 @@ xfs_qm_flush_one( */ if (!xfs_dqflock_nowait(dqp)) { /* buf is pinned in-core by delwri list */ - bp = xfs_buf_incore(mp->m_ddev_targp, dqp->q_blkno, - mp->m_quotainfo->qi_dqchunklen, 0); - if (!bp) { - error = -EINVAL; + error = xfs_buf_incore(mp->m_ddev_targp, dqp->q_blkno, + mp->m_quotainfo->qi_dqchunklen, 0, &bp); + if (error) goto out_unlock; - } + xfs_buf_unlock(bp); xfs_buf_delwri_pushbuf(bp, buffer_list); |