Ticket #4101 (closed defect: fixed)

Opened 3 months ago

Last modified 8 weeks ago

When copying two symlinks using "Follow links" the output is all wrong

Reported by: gv Owned by: andrew_b
Priority: minor Milestone: 4.8.26
Component: mc-core Version: 4.8.24
Keywords: Cc:
Blocked By: Blocking:
Branch state: merged Votes for changeset: committed-master

Description (last modified by andrew_b) (diff)

When copying two symlinks (to two directories containing multiple (large) files and directories) using "Follow links" the output is all wrong. See attached files.

The directory structure is something like this:

$ ls -RF
.:
1  2
$ ls -RF
.:
01/  02/

./01:
a/  b/

./01/a:
1  2  3@  e/  s/

./01/a/e:
1  2  3  4  5  6  7  8  9

./01/a/s:
1

./01/b:
1  2  3  4  5@  a/

./01/b/a:

./02:
1  2
$ LC_MESSAGES=C mc -V
GNU Midnight Commander 4.8.24
Built with GLib 2.56.4
Using the S-Lang library with terminfo database
With builtin Editor and Aspell support
With optional subshell support
With support for background operations
With mouse support on xterm and Linux console
With internationalization support
With multiple codepages support
Virtual File Systems: cpiofs, tarfs, sfs, extfs, ftpfs, fish
Data types: char: 8; int: 32; long: 64; void *: 64; size_t: 64; off_t: 64;

$LC_MESSAGES=C mc -F
Home directory: /home/xxx
Profile root directory: /home/xxx

[System data]
    Config directory: /etc/mc/
    Data directory:   /usr/share/mc/
    File extension handlers: /usr/libexec/mc/ext.d/
    VFS plugins and scripts: /usr/libexec/mc/
        extfs.d:        /usr/libexec/mc/extfs.d/
        fish:           /usr/libexec/mc/fish/

[User data]
    Config directory: /home/xxx/.config/mc/
    Data directory:   /home/xxx/.local/share/mc/
        skins:          /home/xxx/.local/share/mc/skins/
        extfs.d:        /home/xxx/.local/share/mc/extfs.d/
        fish:           /home/xxx/.local/share/mc/fish/
        mcedit macros:  /home/xxx/.local/share/mc/mc.macros
        mcedit external macros: /home/xxx/.local/share/mc/mcedit/macros.d/macro.*
    Cache directory:  /home/xxx/.cache/mc/

Attachments

mc-1.png (7.0 KB) - added by gv 3 months ago.
mc-2.png (7.1 KB) - added by gv 3 months ago.
tree.tar.bz2 (360 bytes) - added by gv 3 months ago.
mc-3.png (6.9 KB) - added by gv 8 weeks ago.

Change History

Changed 3 months ago by gv

Changed 3 months ago by gv

comment:1 Changed 3 months ago by gv

During the copy operation the screen/gui change from mc-1.png to mc-2.png and back.
The symlinks are for the directories 01 and 02.

comment:2 Changed 3 months ago by andrew_b

  • Description modified (diff)

comment:3 Changed 3 months ago by andrew_b

  • Description modified (diff)

comment:4 Changed 3 months ago by andrew_b

Could you please create a small tar file with such directory contents? Or just show the output of ls -lR.

Changed 3 months ago by gv

comment:5 Changed 3 months ago by gv

Just replace at least one file in each directory with a large iso file.
Thank you.

comment:6 Changed 2 months ago by andrew_b

  • Status changed from new to accepted
  • Owner set to andrew_b
  • Branch state changed from no branch to on review
  • Milestone changed from Future Releases to 4.8.26

Branch: 4101_copy_follow_links
Initial changeset:d288528e4ed59217a650318c9cb0c5a66072ae18

Please test.

comment:7 follow-up: ↓ 8 Changed 8 weeks ago by gv

Applied d288528e4ed59217a650318c9cb0c5a66072ae18 and 9e7d34578a8c3f4dd51ead04f7b63ca13bfbc33f.
Your changes does not fix the issue. See mc-3.png

Thank you.

Changed 8 weeks ago by gv

comment:8 in reply to: ↑ 7 ; follow-up: ↓ 9 Changed 8 weeks ago by andrew_b

Replying to gv:

Applied d288528e4ed59217a650318c9cb0c5a66072ae18 and 9e7d34578a8c3f4dd51ead04f7b63ca13bfbc33f.

Are you sure you're running mc with these patches?

comment:9 in reply to: ↑ 8 ; follow-up: ↓ 10 Changed 8 weeks ago by gv

Replying to andrew_b:

Replying to gv:

Applied d288528e4ed59217a650318c9cb0c5a66072ae18 and 9e7d34578a8c3f4dd51ead04f7b63ca13bfbc33f.

Are you sure you're running mc with these patches?

Yes, 100%.

comment:10 in reply to: ↑ 9 ; follow-up: ↓ 11 Changed 8 weeks ago by andrew_b

Replying to gv:

Yes, 100%.

I'm unable to reproduce this.

comment:11 in reply to: ↑ 10 Changed 8 weeks ago by gv

Replying to andrew_b:

I'm unable to reproduce this.

rm -rf dir1 dir2

mkdir -p dir1/01 dir2/{02/a,02/b,03,04}

dd if=/dev/zero of=dir1/01/file.dat bs=1M count=350
dd if=/dev/zero of=dir2/02/a/file.dat bs=1M count=15360
dd if=/dev/zero of=dir2/02/b/file.dat bs=1M count=3072
dd if=/dev/zero of=dir2/03/file.dat bs=1M count=2048
dd if=/dev/zero of=dir2/04/file.dat bs=1M count=8132

ln -s ../dir2/02 dir1/02
ln -s ../dir2/03 dir1/03
ln -s ../dir2/04 dir1/04

sync

Now copy dir1 as dir3 and make sure you check "Follow links".

comment:12 follow-ups: ↓ 13 ↓ 14 Changed 8 weeks ago by andrew_b

Works fine for me. All progress values are correct.

comment:13 in reply to: ↑ 12 Changed 8 weeks ago by gv

Replying to andrew_b:

Works fine for me. All progress values are correct.

Did you try on 4.8.25 or you are working on a branch? Maybe not all your changes are in 4.8.25.

comment:14 in reply to: ↑ 12 Changed 8 weeks ago by gv

Replying to andrew_b:

Works fine for me. All progress values are correct.

Now is working for me, too. Same binary (build) that has not been working all day.
Strange...

I will test again tomorrow maybe the behavior will change again.

Anyway, thank you.

comment:15 follow-up: ↓ 16 Changed 8 weeks ago by gv

When I try to copy dir1 as dir3, your fix works every time.

If I manually create dir3 directory, select all directories in dir1 using Ins key, hit F5, select dir3 as target directory, check "Follow links" and press Enter the fix is not working.

comment:16 in reply to: ↑ 15 ; follow-up: ↓ 17 Changed 8 weeks ago by andrew_b

Thanks for testing!

Replying to gv:

If I manually create dir3 directory, select all directories in dir1 using Ins key, hit F5, select dir3 as target directory, check "Follow links" and press Enter the fix is not working.

Confirmed. This test case fails.

I added two commits:

330335d448f9a1243434229119cd25a2f3549a4c
cb22b1263af845a80c003d551eb69a288037f070

Please test.

comment:17 in reply to: ↑ 16 Changed 8 weeks ago by gv

Replying to andrew_b:

Confirmed. This test case fails.

I added two commits:

330335d448f9a1243434229119cd25a2f3549a4c
cb22b1263af845a80c003d551eb69a288037f070

Please test.

The issue seems to be fixed. Thank you!

comment:18 Changed 8 weeks ago by andrew_b

  • Votes for changeset set to gv andrew_b
  • Branch state changed from on review to approved

comment:19 Changed 8 weeks ago by andrew_b

  • Status changed from accepted to testing
  • Votes for changeset changed from gv andrew_b to committed-master
  • Resolution set to fixed
  • Branch state changed from approved to merged

Merged to master: [348011025df7d6af515f82d96735189a407ddb4d].

git log --pretty=oneline 72740285d..348011025

comment:20 Changed 8 weeks ago by andrew_b

  • Status changed from testing to closed
Note: See TracTickets for help on using tickets.