lkml.org 
[lkml]   [2022]   [Apr]   [26]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    From
    Subject[PATCH 5.15 005/124] xfs: return errors in xfs_fs_sync_fs
    Date
    From: Darrick J. Wong <djwong@kernel.org>

    [ Upstream commit 2d86293c70750e4331e9616aded33ab6b47c299d ]

    Now that the VFS will do something with the return values from
    ->sync_fs, make ours pass on error codes.

    Signed-off-by: Darrick J. Wong <djwong@kernel.org>
    Reviewed-by: Jan Kara <jack@suse.cz>
    Reviewed-by: Christoph Hellwig <hch@lst.de>
    Acked-by: Christian Brauner <brauner@kernel.org>
    Signed-off-by: Sasha Levin <sashal@kernel.org>
    ---
    fs/xfs/xfs_super.c | 6 +++++-
    1 file changed, 5 insertions(+), 1 deletion(-)

    --- a/fs/xfs/xfs_super.c
    +++ b/fs/xfs/xfs_super.c
    @@ -729,6 +729,7 @@ xfs_fs_sync_fs(
    int wait)
    {
    struct xfs_mount *mp = XFS_M(sb);
    + int error;

    trace_xfs_fs_sync_fs(mp, __return_address);

    @@ -738,7 +739,10 @@ xfs_fs_sync_fs(
    if (!wait)
    return 0;

    - xfs_log_force(mp, XFS_LOG_SYNC);
    + error = xfs_log_force(mp, XFS_LOG_SYNC);
    + if (error)
    + return error;
    +
    if (laptop_mode) {
    /*
    * The disk must be active because we're syncing.

    \
     
     \ /
      Last update: 2022-04-26 11:05    [W:4.750 / U:0.072 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site