Re: [PATCH 1/2] copy: log the error number when failing to write
"Darrick J. Wong" <[email protected]> Wed, 29 Jul 2026 08:29:34 -0700
| Newsgroups | org.kernel.vger.linux-xfs |
|---|---|
| Message-ID | <20260729152934.GW2901224@frogsfrogsfrogs> |
On Wed, Jul 29, 2026 at 02:58:56PM +0200, Christoph Hellwig wrote: > Log the string form of the errno value to help debugging a failed write. > > Signed-off-by: Christoph Hellwig <[email protected]> Good idea! Reviewed-by: "Darrick J. Wong" <[email protected]> --D > --- > copy/xfs_copy.c | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) > > diff --git a/copy/xfs_copy.c b/copy/xfs_copy.c > index 3ba9a07e4469..ad18ceb1ac1b 100644 > --- a/copy/xfs_copy.c > +++ b/copy/xfs_copy.c > @@ -891,8 +891,8 @@ main(int argc, char **argv) > off -= XFS_MAX_SECTORSIZE; > len = pwrite(target[i].fd, lb, XFS_MAX_SECTORSIZE, off); > if (len < 0) { > - do_log(_("%s: failed to write last block\n"), > - progname); > + do_log(_("%s: failed to write last block: %s\n"), > + progname, strerror(errno)); > do_log(_("\tIs target \"%s\" too small?\n"), > target[i].name); > die_perror(); > -- > 2.53.0 > >