git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Junio C Hamano <gitster@pobox.com>
To: Jonathan Nieder <jrnieder@gmail.com>
Cc: Brian Gernhardt <brian@gernhardtsoftware.com>,
	"git\@vger.kernel.org List" <git@vger.kernel.org>,
	David Barr <david.barr@cordelta.com>,
	Junio C Hamano <gitster@pobox.com>
Subject: Re: [PATCH jn/fast-import-blob-access] t9300: avoid short reads from dd
Date: Sun, 12 Dec 2010 23:21:37 -0800	[thread overview]
Message-ID: <7vfwu25e9q.fsf@alter.siamese.dyndns.org> (raw)
In-Reply-To: <20101213063151.GB20812@burratino> (Jonathan Nieder's message of "Mon\, 13 Dec 2010 00\:31\:51 -0600")

Jonathan Nieder <jrnieder@gmail.com> writes:

> dd is a thin wrapper around read(2).  As open group Issue 7 explains:
>
> 	It shall read the input one block at a time, using the specified
> 	input block size; it shall then process the block of data
> 	actually returned, which could be smaller than the requested
> 	block size.
>
> Any short read --- for example from a pipe whose capacity cannot fill
> a block --- results in that block being truncated.  As a result, the
> first cat-blob test (9300.114) fails on Mac OS X, where the pipe
> capacity is around 8 KiB.

I saw a similar breakage on my FBSD 8 bochs.  It is unfortunate and feels
yucky that we have to issue 8k+ read(2) of one byte, but I don't think of
a better way.  I thought it might be possible to specify cbs and/or conv
to have the input buffered to a size to defeat the short read issue, but
count specifies in terms of input blocks, so there doesn't seem to be a
way to do so...  Oh well...

Thanks.

  reply	other threads:[~2010-12-13  7:21 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-12-12 20:49 SIGPIPE in t9300-fast-import Brian Gernhardt
2010-12-12 21:49 ` Jonathan Nieder
2010-12-12 22:04   ` Brian Gernhardt
2010-12-13  6:31     ` [PATCH jn/fast-import-blob-access] t9300: avoid short reads from dd Jonathan Nieder
2010-12-13  7:21       ` Junio C Hamano [this message]
2010-12-13  9:28         ` [PATCH jn/fast-import-blob-access] t9300: use perl "head -c" clone in place of "dd bs=1 count=16000" kluge Jonathan Nieder

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: http://vger.kernel.org/majordomo-info.html

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=7vfwu25e9q.fsf@alter.siamese.dyndns.org \
    --to=gitster@pobox.com \
    --cc=brian@gernhardtsoftware.com \
    --cc=david.barr@cordelta.com \
    --cc=git@vger.kernel.org \
    --cc=jrnieder@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).