···146146 NFS_O_RDWR_STATE, /* OPEN stateid has read/write state */147147 NFS_STATE_RECLAIM_REBOOT, /* OPEN stateid server rebooted */148148 NFS_STATE_RECLAIM_NOGRACE, /* OPEN stateid needs to recover state */149149+ NFS_STATE_POSIX_LOCKS, /* Posix locks are supported */149150};150151151152struct nfs4_state {
+6-1
fs/nfs/nfs4proc.c
···16581658 status = PTR_ERR(state);16591659 if (IS_ERR(state))16601660 goto err_opendata_put;16611661+ if ((opendata->o_res.rflags & NFS4_OPEN_RESULT_LOCKTYPE_POSIX) != 0)16621662+ set_bit(NFS_STATE_POSIX_LOCKS, &state->flags);16611663 nfs4_opendata_put(opendata);16621664 nfs4_put_state_owner(sp);16631665 *res = state;···42024200{42034201 struct nfs_inode *nfsi = NFS_I(state->inode);42044202 unsigned char fl_flags = request->fl_flags;42054205- int status;42034203+ int status = -ENOLCK;4206420442054205+ if ((fl_flags & FL_POSIX) &&42064206+ !test_bit(NFS_STATE_POSIX_LOCKS, &state->flags))42074207+ goto out;42074208 /* Is this a delegated open? */42084209 status = nfs4_set_lock_state(state, request);42094210 if (status != 0)