Re: [PATCH 7/7] reiserfs: propagate issue-flush error code

Bartlomiej Zolnierkiewicz
2009-03-30T15:24:07Z

On Monday 30 March 2009, Fernando Luis Vázquez Cao wrote:
> blkdev_issue_flush() may fail (i.e. due to media error on FLUSH CACHE
> command execution) so its users should check for the return value.
>
> Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
> Signed-off-by: Fernando Luis Vazquez Cao <fernando@oss.ntt.co.jp>
> ---
>
> diff -urNp linux-2.6.29-orig/fs/reiserfs/file.c linux-2.6.29/fs/reiserfs/file.c
> --- linux-2.6.29-orig/fs/reiserfs/file.c 2009-03-24 08:12:14.000000000 +0900
> +++ linux-2.6.29/fs/reiserfs/file.c 2009-03-30 16:19:19.000000000 +0900
> @@ -146,8 +146,9 @@ static int reiserfs_sync_file(struct fil
> reiserfs_write_lock(p_s_inode->i_sb);
> barrier_done = reiserfs_commit_for_inode(p_s_inode);
> reiserfs_write_unlock(p_s_inode->i_sb);
> - if (barrier_done != 1 && reiserfs_barrier_flush(p_s_inode->i_sb))
> - blkdev_issue_flush(p_s_inode->i_sb->s_bdev, NULL);
> + if (!n_err && barrier_done != 1 &&
> + reiserfs_barrier_flush(p_s_inode->i_sb))
> + n_err = block_flush_device(p_s_inode->i_sb->s_bdev);

This is again different from my original patch
(the change in behavior should be documented).

Thanks,
Bart