#1014880 sftp_readdir_async: Assertion `offset == 0' failed on OPENDIR when mounted through nfs

Package:
sshfs
Source:
sshfs-fuse
Description:
filesystem client based on SSH File Transfer Protocol
Submitter:
Frank de Lange
Date:
2022-07-22 07:57:03 UTC
Severity:
normal
#1014880#5
Date:
2022-07-13 16:20:02 UTC
From:
To:
Given the following setup:

 - remote directory mounted to /mnt/incoming on server using the
   following options:
   sshfs -d --debug librarian@archive:/mnt/incoming /mnt/incoming -o rw,delay_connect,transform_symlinks,idmap=user,allow_other,uid=1011,gid=1011,identityfile=/home/librarian/.ssh/id_rsa,dev,suid,dir_cache=no
 - /mnt/incoming bind-mounted to /srv/nfs/incoming
 - /srv/nfs/incoming exported through nfsv4
 - /srv/nfs/incoming nfsv4-mounted on workstation on /net/media/incoming

Listing the contents of /mnt/incoming or the bind-mounted version on
/srv/nfs/incoming works without problems, as does accessing files
residing in these directories.

Attempting to access the nfs-exported version of this filesystem from a workstation leads to sshfs aborting with the following assertion:

  [00035] OPENDIR
    [00035]         HANDLE       17bytes (0ms)
     unique: 66, success, outsize: 32
  unique: 68, opcode: READDIRPLUS (44), nodeid: 1, insize: 80, pid: 0
  sshfs: ../sshfs.c:2216: sftp_readdir_async: Assertion `offset == 0' failed.
  Aborted

When mounted with the directory cache enabled (dir_cache=yes) this
assertion occurs in cache_readdir instead.