Code Monkey home page Code Monkey logo

Comments (6)

kofemann avatar kofemann commented on July 17, 2024

Hi,

though the spec doesn't clearly says it, server should return subsequent entries. IOW, if cookie is 102 then server should return directory listing starting from entry 103, as Linux server correctly does. If nfs4j re-sends 102, then this is a clear bug. However, the READDIR operation expects that VFS layer does the right thing

The returned listing will contain only entries with cookies greater than specified value.

* is used. The returned listing will contain only entries with cookies

Does your filesystem backend preserves this behavior?

from nfs4j.

sraillard avatar sraillard commented on July 17, 2024

Thank for pointing that! We have found a bug in th VFS and we'll fix it.

Do you have any opinion about the last directory entry cookie set to 2147483647 by the Linux NFS server?

from nfs4j.

kofemann avatar kofemann commented on July 17, 2024

Great! The 2147483647 is 0x7fffffff and looks like a magic number used by the backend file system to indicate some special value, last block, for example. Do you use xfs?

from nfs4j.

sraillard avatar sraillard commented on July 17, 2024

The filesystem used was btrfs with Fedora Linux OS.

It's clearly looking like a magic number, but I didn't find any reference of this value in the RFC.

from nfs4j.

kofemann avatar kofemann commented on July 17, 2024

This is linux fs specific and have nothing to do with NFS spec.

linux-kernel $ git grep 0x7fffffff fs
fs/affs/file.c: BUG_ON(block > (sector_t)0x7fffffffUL);
fs/afs/internal.h:#define __AFS_PAGE_PRIV_MASK  0x7fffffffUL
fs/ext2/inode.c:                if (inode->i_size > 0x7fffffffULL) {
fs/ext4/hash.c:                 hash -= 0x7fffffff;
fs/ext4/hash.c:                 hash -= 0x7fffffff;
fs/ext4/inode-test.c:#define UPPER_MSB_0 0x7fffffffL
fs/ext4/inode-test.c:                   .expected = {.tv_sec = 0x7fffffffLL, .tv_nsec = 0L},
fs/ext4/inode.c:        if (pos + len <= 0x7fffffffULL)
fs/ext4/inode.c:        if (ei->i_disksize > 0x7fffffffULL) {
fs/kernfs/dir.c:        hash &= 0x7fffffffU;
fs/nfs/proc.c:#define NFS_LOCK32_OFFSET_MAX ((__s32)0x7fffffffUL)
fs/nfsd/vfs.c:          v_mtime = verifier[0]&0x7fffffff;
fs/nfsd/vfs.c:          v_atime = verifier[1]&0x7fffffff;
fs/ntfs/super.c:        if (i_size <= 0 || i_size > 0x7fffffff)
fs/ocfs2/cluster/tcp.h:#define O2NET_TCP_USER_TIMEOUT                   0x7fffffff
fs/ocfs2/quota_local.c: info->dqi_max_spc_limit = 0x7fffffffffffffffLL;
fs/ocfs2/quota_local.c: info->dqi_max_ino_limit = 0x7fffffffffffffffLL;
fs/proc/array.c:        seq_put_decimal_ull(m, " ", task->pending.signal.sig[0] & 0x7fffffffUL);
fs/proc/array.c:        seq_put_decimal_ull(m, " ", task->blocked.sig[0] & 0x7fffffffUL);
fs/proc/array.c:        seq_put_decimal_ull(m, " ", sigign.sig[0] & 0x7fffffffUL);
fs/proc/array.c:        seq_put_decimal_ull(m, " ", sigcatch.sig[0] & 0x7fffffffUL);
fs/quota/quota_v2.c:            info->dqi_max_spc_limit = 0x7fffffffffffffffLL; /* 2^63-1 */
fs/quota/quota_v2.c:            info->dqi_max_ino_limit = 0x7fffffffffffffffLL;
fs/vboxsf/shfl_hostintf.h:      SHFLFSOBJATTRADD_32BIT_SIZE_HACK = 0x7fffffff
fs/xfs/libxfs/xfs_types.h:#define       MAXEXTNUM       ((xfs_extnum_t)0x7fffffff)      /* signed int */
fs/xfs/xfs_dir2_readdir.c:              ctx->pos = dot_offset & 0x7fffffff;
fs/xfs/xfs_dir2_readdir.c:              ctx->pos = dotdot_offset & 0x7fffffff;
fs/xfs/xfs_dir2_readdir.c:              ctx->pos = off & 0x7fffffff;
fs/xfs/xfs_dir2_readdir.c:                                                              0x7fffffff;
fs/xfs/xfs_dir2_readdir.c:              ctx->pos = cook & 0x7fffffff;
fs/xfs/xfs_dir2_readdir.c:                                                              0x7fffffff;
fs/xfs/xfs_dir2_readdir.c:              ctx->pos = xfs_dir2_byte_to_dataptr(curoff) & 0x7fffffff;
fs/xfs/xfs_dir2_readdir.c:              ctx->pos = XFS_DIR2_MAX_DATAPTR & 0x7fffffff;
fs/xfs/xfs_dir2_readdir.c:              ctx->pos = xfs_dir2_byte_to_dataptr(curoff) & 0x7fffffff;
linux-kernel $

from nfs4j.

sraillard avatar sraillard commented on July 17, 2024

Clearly a magic number widley used...

Thank you for all you help!

from nfs4j.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.