dCache / nfs4j

Pure Java NFSv3 and NFSv4.2 implementation
Other
240 stars 76 forks source link

NFSv4 server looses open-stateid sequence in concurrent environment #120

Closed kofemann closed 1 year ago

kofemann commented 1 year ago

When NFS client issued a large number of concurrent opens to the same file, the sequence id of the open-stateid might be miscalculated. As a result, the client will get OLD_STATEID on CLOSE. The race comes from unfenced update during the open

        stateid4 stateid = context
                .getStateHandler()
                .getFileTracker()
                .addOpen(client, owner, context.currentInode(),
                _args.opopen.share_access.value,
                _args.opopen.share_deny.value);

        stateid.seqid++;