···146 NFS_O_RDWR_STATE, /* OPEN stateid has read/write state */147 NFS_STATE_RECLAIM_REBOOT, /* OPEN stateid server rebooted */148 NFS_STATE_RECLAIM_NOGRACE, /* OPEN stateid needs to recover state */0149};150151struct nfs4_state {
···146 NFS_O_RDWR_STATE, /* OPEN stateid has read/write state */147 NFS_STATE_RECLAIM_REBOOT, /* OPEN stateid server rebooted */148 NFS_STATE_RECLAIM_NOGRACE, /* OPEN stateid needs to recover state */149+ NFS_STATE_POSIX_LOCKS, /* Posix locks are supported */150};151152struct nfs4_state {
+6-1
fs/nfs/nfs4proc.c
···1658 status = PTR_ERR(state);1659 if (IS_ERR(state))1660 goto err_opendata_put;001661 nfs4_opendata_put(opendata);1662 nfs4_put_state_owner(sp);1663 *res = state;···4202{4203 struct nfs_inode *nfsi = NFS_I(state->inode);4204 unsigned char fl_flags = request->fl_flags;4205- int status;42060004207 /* Is this a delegated open? */4208 status = nfs4_set_lock_state(state, request);4209 if (status != 0)
···1658 status = PTR_ERR(state);1659 if (IS_ERR(state))1660 goto err_opendata_put;1661+ if ((opendata->o_res.rflags & NFS4_OPEN_RESULT_LOCKTYPE_POSIX) != 0)1662+ set_bit(NFS_STATE_POSIX_LOCKS, &state->flags);1663 nfs4_opendata_put(opendata);1664 nfs4_put_state_owner(sp);1665 *res = state;···4200{4201 struct nfs_inode *nfsi = NFS_I(state->inode);4202 unsigned char fl_flags = request->fl_flags;4203+ int status = -ENOLCK;42044205+ if ((fl_flags & FL_POSIX) &&4206+ !test_bit(NFS_STATE_POSIX_LOCKS, &state->flags))4207+ goto out;4208 /* Is this a delegated open? */4209 status = nfs4_set_lock_state(state, request);4210 if (status != 0)