@@ -1491,9 +1491,10 @@ xfs_buf_delwri_submit(
list_for_each_entry_safe(bp, n, buffer_list, b_list) {
list_del_init(&bp->b_list);
- error2 = libxfs_writebuf(bp, 0);
+ error2 = libxfs_writebufr(bp);
if (!error)
error = error2;
+ libxfs_putbuf(bp);
}
return error;
@@ -3685,6 +3685,7 @@ main(
};
struct list_head buffer_list;
+ int error;
platform_uuid_generate(&cli.uuid);
progname = basename(argv[0]);
@@ -3885,16 +3886,19 @@ main(
if (agno % 16)
continue;
- if (libxfs_buf_delwri_submit(&buffer_list)) {
- fprintf(stderr, _("%s: writing AG headers failed\n"),
- progname);
+ error = -libxfs_buf_delwri_submit(&buffer_list);
+ if (error) {
+ fprintf(stderr,
+ _("%s: writing AG headers failed, err=%d\n"),
+ progname, error);
exit(1);
}
}
- if (libxfs_buf_delwri_submit(&buffer_list)) {
- fprintf(stderr, _("%s: writing AG headers failed\n"),
- progname);
+ error = -libxfs_buf_delwri_submit(&buffer_list);
+ if (error) {
+ fprintf(stderr, _("%s: writing AG headers failed, err=%d\n"),
+ progname, error);
exit(1);
}