All of lore.kernel.org
 help / color / mirror / Atom feed
From: Steve French <smfrench@gmail.com>
To: CIFS <linux-cifs@vger.kernel.org>,
	linux-fsdevel <linux-fsdevel@vger.kernel.org>
Cc: Pavel Shilovsky <piastryyy@gmail.com>
Subject: scp bug due to progress indicator when copying from remote to local on Linux
Date: Fri, 11 Jan 2019 00:11:00 -0600	[thread overview]
Message-ID: <CAH2r5mtQTu1mwh0Zpep71A5oHHYboLv5qD=8n_LeASzmncNx4g@mail.gmail.com> (raw)

In discussing an interesting problem with scp recently with Pavel, we
found a fairly obvious bug in scp when it is run with a progress
indicator (which is the default when the source file is remote).

scp triggers "SIGALRM" probably from update_progress_meter() in
progressmeter.c when executed with "scp localhost:somelargefile /mnt"
ie with an ssh source path but a local path for the target, as long as
the flush of the large amount of cached data to disk (which seems to
be triggered by the ftruncate call in scp.c) takes more than a few
seconds (which can be common depending on disk or network speed).

It is interesting that this can be avoided easily by running in quiet
mode ("-q") which disables the progress meter in scp, but it seems
very, very broken that scp of a large file can 'fail' when using a
progress meter (unless caching were disabled on the file system) due
to the slight delay in ftruncate due to triggering a flush of a large
amount of cached data to disk sequentially.

Any thoughts of whether scp is actively maintained and best approach
to fix progressmeter.c so it doesn't break on Linux?

-- 
Thanks,

Steve

             reply	other threads:[~2019-01-11  6:11 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-01-11  6:11 Steve French [this message]
2019-01-11  6:13 ` Fwd: scp bug due to progress indicator when copying from remote to local on Linux Steve French
2019-01-11  8:50 ` Dr. Bernd Feige
2019-01-11 13:28 ` Matthew Wilcox
2019-01-11 21:13   ` Steve French
2019-01-11 21:22     ` Matthew Wilcox
2019-01-11 21:50       ` Steve French
2019-01-11 23:05         ` Matthew Wilcox
2019-01-11 23:18           ` Steve French
2019-01-14 19:48       ` Pavel Shilovsky
2019-01-11 21:48     ` Andreas Dilger
2019-01-11 22:02       ` Steve French
2019-01-11 23:51         ` Andreas Dilger
2019-01-12  0:06           ` Steve French

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

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

  git send-email \
    --in-reply-to='CAH2r5mtQTu1mwh0Zpep71A5oHHYboLv5qD=8n_LeASzmncNx4g@mail.gmail.com' \
    --to=smfrench@gmail.com \
    --cc=linux-cifs@vger.kernel.org \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=piastryyy@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.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.