Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.debian.user > #222153

Re: unexpected behavior of cp and mv

From Alberto Sentieri <22t@tripolho.com>
Newsgroups linux.debian.user
Subject Re: unexpected behavior of cp and mv
Date 2020-04-30 20:10 +0200
Message-ID <A1lNf-1dW-5@gated-at.bofh.it> (permalink)
References <A1kxQ-hk-1@gated-at.bofh.it> <A1lke-Ow-13@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


1 second, 3 seconds or 10 minutes have the same result.

About the 1024 1K-blocks, if one checks the file size on the samba 
server using the same <ls -ls> command, the return will be:
4 -rwxrw-r--  1 root cifsusers       10 Feb  5  2017 test2.txt

So, it is using only 4Kbytes on the server. I have no idea why smb 
interface always reports 1Mbyte. By the way, I have seen this behavior 
for many years. stat (on the workstation) also reports the same (2048 
512-byte blocks).

I will do the tests you suggested later. I am also thinking about trying 
a flush before utimensat. None of this, however, happens in cp.

It may not be utimensat. Between the kernel and the smb, there is a cifs 
package (the driver) which could be doing it wrong. Both the kernel and 
cifs package are different between the two workstations.

Thanks,

Alberto

On 4/30/20 1:32 PM, Thomas Schmitt wrote:
> Hi,
>
> Alberto Sentieri wrote:
>> ls -ls "${NAME}"
>> Note that the /mnt/u1/rw/receipt is a SMB folder. I got this result:
>> 1024 -rwxr-xr-x 1 u1 u1 10 Apr 30 12:20 /mnt/u1/rw/receipt/test2.txt
>> [...]
>> I run the same binary and script on my debian stretch workstation, and got
>> 4 -rwxr-xr-x 1 u1 u1 10 Feb  5  2017 /mnt/u1/rw/receipt/test2.txt
> It is quite remarkable that the SMB file is reported to use 1024 blocks
> for storing 10 bytes.
>
> -------------------------------------------------------------------------
>
> I am still not convinced that SYS_utimensat is to blame.
>
> What do you get if you sleep for 3 seconds before performing it ?
>
> If still the file timestamp changes with that sleep:
> What happens if you close the fd without calling utimensat and
> re-open the file for applying utimensat only then ?
> (What if you let sleep between between close and re-open ?)
>
>
> Have a nice day :)
>
> Thomas
>

Back to linux.debian.user | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

unexpected behavior of cp and mv Alberto Sentieri <22t@tripolho.com> - 2020-04-29 19:10 +0200
  Re: unexpected behavior of cp and mv Roberto C. Sánchez <roberto@debian.org> - 2020-04-29 19:20 +0200
    Re: Re: unexpected behavior of cp and mv Alberto Sentieri <22t@tripolho.com> - 2020-04-29 20:50 +0200
    Re: Re: unexpected behavior of cp and mv Alberto Sentieri <22t@tripolho.com> - 2020-04-29 21:20 +0200
      Re: unexpected behavior of cp and mv David Wright <deblis@lionunicorn.co.uk> - 2020-04-30 03:50 +0200
        Re: unexpected behavior of cp and mv Alberto Sentieri <22t@tripolho.com> - 2020-04-30 06:20 +0200
  Re: unexpected behavior of cp and mv Charles Curley <charlescurley@charlescurley.com> - 2020-04-29 21:20 +0200
    Re: unexpected behavior of cp and mv Alberto Sentieri <22t@tripolho.com> - 2020-04-29 22:10 +0200
      Re: unexpected behavior of cp and mv "Thomas Schmitt" <scdbackup@gmx.net> - 2020-04-29 22:20 +0200
        Re: unexpected behavior of cp and mv Alberto Sentieri <22t@tripolho.com> - 2020-04-29 22:30 +0200
        Re: unexpected behavior of cp and mv Alberto Sentieri <22t@tripolho.com> - 2020-04-29 23:00 +0200
          Re: unexpected behavior of cp and mv "Thomas Schmitt" <scdbackup@gmx.net> - 2020-04-29 23:30 +0200
            Re: unexpected behavior of cp and mv Alberto Sentieri <22t@tripolho.com> - 2020-04-30 06:40 +0200
              Re: unexpected behavior of cp and mv "Thomas Schmitt" <scdbackup@gmx.net> - 2020-04-30 12:40 +0200
                Re: unexpected behavior of cp and mv Alberto Sentieri <22t@tripolho.com> - 2020-04-30 16:20 +0200
            Re: unexpected behavior of cp and mv Alberto Sentieri <22t@tripolho.com> - 2020-04-30 18:50 +0200
              Re: unexpected behavior of cp and mv "Thomas Schmitt" <scdbackup@gmx.net> - 2020-04-30 19:40 +0200
                Re: unexpected behavior of cp and mv Alberto Sentieri <22t@tripolho.com> - 2020-04-30 20:10 +0200
                Re: unexpected behavior of cp and mv Alberto Sentieri <22t@tripolho.com> - 2020-04-30 21:50 +0200
                Re: unexpected behavior of cp and mv The Wanderer <wanderer@fastmail.fm> - 2020-04-30 22:00 +0200
                Re: unexpected behavior of cp and mv Alberto Sentieri <22t@tripolho.com> - 2020-04-30 22:10 +0200
                Re: unexpected behavior of cp and mv Alberto Sentieri <22t@tripolho.com> - 2020-04-30 23:40 +0200
              Re: unexpected behavior of cp and mv David Wright <deblis@lionunicorn.co.uk> - 2020-04-30 20:00 +0200
          Re: unexpected behavior of cp and mv songbird <songbird@anthive.com> - 2020-04-30 00:00 +0200
            Re: unexpected behavior of cp and mv Alberto Sentieri <22t@tripolho.com> - 2020-04-30 06:10 +0200

csiph-web