I tried to track the difference between overlay-NFSv3 and ext4-NFSv3 of encode_post_op_attr. mount configuration: none /share overlay rw,relatime,lowerdir=/base/lower,upperdir=/base/upper,workdir=/base/work,index=on,nfs_export=on 0 0 localhost:/share /mnt/n nfs rw,relatime,vers=3,rsize=1048576,wsize=1048576,namlen=255,hard,proto=tcp,timeo=600,retrans=2,sec=sys,mountaddr=127.0.0.1,mountvers=3,mountport=40931,mountproto=udp,local_lock=none,addr=127.0.0.1 0 0 /dev/loop0 /share2 ext4 rw,relatime,data=ordered 0 0 localhost:/share2 /mnt/n2 nfs rw,relatime,vers=3,rsize=1048576,wsize=1048576,namlen=255,hard,proto=tcp,timeo=600,retrans=2,sec=sys,mountaddr=127.0.0.1,mountvers=3,mountport=40931,mountproto=udp,local_lock=none,addr=127.0.0.1 0 0 file tree: /mnt/n |-- dirA | `-- bar |-- dirL | `-- ro-file `-- foo /mnt/n2 `-- lost+found Attached log are dmesg start from "readdir /mnt/n (n2)" with nfs and nfsd log are enabled all by sunrpc.nfs(d)_debug. I also add a dump_stack() in the beginning of encode_post_op_attr. It seems overlay and ext4 have different call flow after "nfsd: READDIR+", there is no failure in overlay's encode_post_op_attr, nfsd does fill the attrs, same as ext4 but it has additional readdir call to child node of "/". I'm not sure if this is normal to overlay and is the cause of DT_UNKNOWN. In additional, overlay returns DT_UNKNOWN to either lower dir or merged dir. /readdir/a.out /mnt/n readdir: dirL ino(e007c) type(0) readdir: . ino(e000c) type(0) readdir: .. ino(e000c) type(0) readdir: foo ino(e0005) type(0) readdir: dirA ino(e0006) type(0) /readdir/a.out /mnt/n2 readdir: lost+found ino(b) type(4) readdir: .. ino(2) type(0) readdir: . ino(2) type(4) thanks, Eddie
Attachment:
ext4_nfs3_readdir.log
Description: Binary data
Attachment:
overlay_nfs3_readdir.log
Description: Binary data