Skip to content

Commit 1227561

Browse files
committed
NFSD: Revert 738401a
There's nothing wrong with this commit, but this is dead code now that nothing triggers a CB_GETATTR callback. It can be re-introduced once the issues with handling conflicting GETATTRs are resolved. Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
1 parent 862bee8 commit 1227561

File tree

3 files changed

+1
-128
lines changed

3 files changed

+1
-128
lines changed

fs/nfsd/nfs4callback.c

Lines changed: 1 addition & 96 deletions
Original file line numberDiff line numberDiff line change
@@ -84,21 +84,7 @@ static void encode_uint32(struct xdr_stream *xdr, u32 n)
8484
static void encode_bitmap4(struct xdr_stream *xdr, const __u32 *bitmap,
8585
size_t len)
8686
{
87-
xdr_stream_encode_uint32_array(xdr, bitmap, len);
88-
}
89-
90-
static int decode_cb_fattr4(struct xdr_stream *xdr, uint32_t *bitmap,
91-
struct nfs4_cb_fattr *fattr)
92-
{
93-
fattr->ncf_cb_change = 0;
94-
fattr->ncf_cb_fsize = 0;
95-
if (bitmap[0] & FATTR4_WORD0_CHANGE)
96-
if (xdr_stream_decode_u64(xdr, &fattr->ncf_cb_change) < 0)
97-
return -NFSERR_BAD_XDR;
98-
if (bitmap[0] & FATTR4_WORD0_SIZE)
99-
if (xdr_stream_decode_u64(xdr, &fattr->ncf_cb_fsize) < 0)
100-
return -NFSERR_BAD_XDR;
101-
return 0;
87+
WARN_ON_ONCE(xdr_stream_encode_uint32_array(xdr, bitmap, len) < 0);
10288
}
10389

10490
/*
@@ -371,30 +357,6 @@ encode_cb_recallany4args(struct xdr_stream *xdr,
371357
hdr->nops++;
372358
}
373359

374-
/*
375-
* CB_GETATTR4args
376-
* struct CB_GETATTR4args {
377-
* nfs_fh4 fh;
378-
* bitmap4 attr_request;
379-
* };
380-
*
381-
* The size and change attributes are the only one
382-
* guaranteed to be serviced by the client.
383-
*/
384-
static void
385-
encode_cb_getattr4args(struct xdr_stream *xdr, struct nfs4_cb_compound_hdr *hdr,
386-
struct nfs4_cb_fattr *fattr)
387-
{
388-
struct nfs4_delegation *dp =
389-
container_of(fattr, struct nfs4_delegation, dl_cb_fattr);
390-
struct knfsd_fh *fh = &dp->dl_stid.sc_file->fi_fhandle;
391-
392-
encode_nfs_cb_opnum4(xdr, OP_CB_GETATTR);
393-
encode_nfs_fh4(xdr, fh);
394-
encode_bitmap4(xdr, fattr->ncf_cb_bmap, ARRAY_SIZE(fattr->ncf_cb_bmap));
395-
hdr->nops++;
396-
}
397-
398360
/*
399361
* CB_SEQUENCE4args
400362
*
@@ -530,26 +492,6 @@ static void nfs4_xdr_enc_cb_null(struct rpc_rqst *req, struct xdr_stream *xdr,
530492
xdr_reserve_space(xdr, 0);
531493
}
532494

533-
/*
534-
* 20.1. Operation 3: CB_GETATTR - Get Attributes
535-
*/
536-
static void nfs4_xdr_enc_cb_getattr(struct rpc_rqst *req,
537-
struct xdr_stream *xdr, const void *data)
538-
{
539-
const struct nfsd4_callback *cb = data;
540-
struct nfs4_cb_fattr *ncf =
541-
container_of(cb, struct nfs4_cb_fattr, ncf_getattr);
542-
struct nfs4_cb_compound_hdr hdr = {
543-
.ident = cb->cb_clp->cl_cb_ident,
544-
.minorversion = cb->cb_clp->cl_minorversion,
545-
};
546-
547-
encode_cb_compound4args(xdr, &hdr);
548-
encode_cb_sequence4args(xdr, cb, &hdr);
549-
encode_cb_getattr4args(xdr, &hdr, ncf);
550-
encode_cb_nops(&hdr);
551-
}
552-
553495
/*
554496
* 20.2. Operation 4: CB_RECALL - Recall a Delegation
555497
*/
@@ -605,42 +547,6 @@ static int nfs4_xdr_dec_cb_null(struct rpc_rqst *req, struct xdr_stream *xdr,
605547
return 0;
606548
}
607549

608-
/*
609-
* 20.1. Operation 3: CB_GETATTR - Get Attributes
610-
*/
611-
static int nfs4_xdr_dec_cb_getattr(struct rpc_rqst *rqstp,
612-
struct xdr_stream *xdr,
613-
void *data)
614-
{
615-
struct nfsd4_callback *cb = data;
616-
struct nfs4_cb_compound_hdr hdr;
617-
int status;
618-
u32 bitmap[3] = {0};
619-
u32 attrlen;
620-
struct nfs4_cb_fattr *ncf =
621-
container_of(cb, struct nfs4_cb_fattr, ncf_getattr);
622-
623-
status = decode_cb_compound4res(xdr, &hdr);
624-
if (unlikely(status))
625-
return status;
626-
627-
status = decode_cb_sequence4res(xdr, cb);
628-
if (unlikely(status || cb->cb_seq_status))
629-
return status;
630-
631-
status = decode_cb_op_status(xdr, OP_CB_GETATTR, &cb->cb_status);
632-
if (status)
633-
return status;
634-
if (xdr_stream_decode_uint32_array(xdr, bitmap, 3) < 0)
635-
return -NFSERR_BAD_XDR;
636-
if (xdr_stream_decode_u32(xdr, &attrlen) < 0)
637-
return -NFSERR_BAD_XDR;
638-
if (attrlen > (sizeof(ncf->ncf_cb_change) + sizeof(ncf->ncf_cb_fsize)))
639-
return -NFSERR_BAD_XDR;
640-
status = decode_cb_fattr4(xdr, bitmap, ncf);
641-
return status;
642-
}
643-
644550
/*
645551
* 20.2. Operation 4: CB_RECALL - Recall a Delegation
646552
*/
@@ -949,7 +855,6 @@ static const struct rpc_procinfo nfs4_cb_procedures[] = {
949855
PROC(CB_NOTIFY_LOCK, COMPOUND, cb_notify_lock, cb_notify_lock),
950856
PROC(CB_OFFLOAD, COMPOUND, cb_offload, cb_offload),
951857
PROC(CB_RECALL_ANY, COMPOUND, cb_recall_any, cb_recall_any),
952-
PROC(CB_GETATTR, COMPOUND, cb_getattr, cb_getattr),
953858
};
954859

955860
static unsigned int nfs4_cb_counts[ARRAY_SIZE(nfs4_cb_procedures)];

fs/nfsd/state.h

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -117,16 +117,6 @@ struct nfs4_cpntf_state {
117117
time64_t cpntf_time; /* last time stateid used */
118118
};
119119

120-
struct nfs4_cb_fattr {
121-
struct nfsd4_callback ncf_getattr;
122-
u32 ncf_cb_status;
123-
u32 ncf_cb_bmap[1];
124-
125-
/* from CB_GETATTR reply */
126-
u64 ncf_cb_change;
127-
u64 ncf_cb_fsize;
128-
};
129-
130120
/*
131121
* Represents a delegation stateid. The nfs4_client holds references to these
132122
* and they are put when it is being destroyed or when the delegation is
@@ -160,9 +150,6 @@ struct nfs4_delegation {
160150
int dl_retries;
161151
struct nfsd4_callback dl_recall;
162152
bool dl_recalled;
163-
164-
/* for CB_GETATTR */
165-
struct nfs4_cb_fattr dl_cb_fattr;
166153
};
167154

168155
#define cb_to_delegation(cb) \
@@ -653,7 +640,6 @@ enum nfsd4_cb_op {
653640
NFSPROC4_CLNT_CB_SEQUENCE,
654641
NFSPROC4_CLNT_CB_NOTIFY_LOCK,
655642
NFSPROC4_CLNT_CB_RECALL_ANY,
656-
NFSPROC4_CLNT_CB_GETATTR,
657643
};
658644

659645
/* Returns true iff a is later than b: */

fs/nfsd/xdr4cb.h

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -54,21 +54,3 @@
5454
#define NFS4_dec_cb_recall_any_sz (cb_compound_dec_hdr_sz + \
5555
cb_sequence_dec_sz + \
5656
op_dec_sz)
57-
58-
/*
59-
* 1: CB_GETATTR opcode (32-bit)
60-
* N: file_handle
61-
* 1: number of entry in attribute array (32-bit)
62-
* 1: entry 0 in attribute array (32-bit)
63-
*/
64-
#define NFS4_enc_cb_getattr_sz (cb_compound_enc_hdr_sz + \
65-
cb_sequence_enc_sz + \
66-
1 + enc_nfs4_fh_sz + 1 + 1)
67-
/*
68-
* 4: fattr_bitmap_maxsz
69-
* 1: attribute array len
70-
* 2: change attr (64-bit)
71-
* 2: size (64-bit)
72-
*/
73-
#define NFS4_dec_cb_getattr_sz (cb_compound_dec_hdr_sz + \
74-
cb_sequence_dec_sz + 4 + 1 + 2 + 2 + op_dec_sz)

0 commit comments

Comments
 (0)