Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Merge tag 'nfsd-5.18-1' of git://git.kernel.org/pub/scm/linux/kernel/git/cel/linux

Pull nfsd fixes from Chuck Lever:

- Fix a write performance regression

- Fix crashes during request deferral on RDMA transports

* tag 'nfsd-5.18-1' of git://git.kernel.org/pub/scm/linux/kernel/git/cel/linux:
SUNRPC: Fix the svc_deferred_event trace class
SUNRPC: Fix NFSD's request deferral on RDMA transports
nfsd: Clean up nfsd_file_put()
nfsd: Fix a write performance regression
SUNRPC: Return true/false (not 1/0) from bool functions

+36 -26
+15 -10
fs/nfsd/filecache.c
··· 237 237 } 238 238 239 239 static void 240 + nfsd_file_flush(struct nfsd_file *nf) 241 + { 242 + if (nf->nf_file && vfs_fsync(nf->nf_file, 1) != 0) 243 + nfsd_reset_write_verifier(net_generic(nf->nf_net, nfsd_net_id)); 244 + } 245 + 246 + static void 240 247 nfsd_file_do_unhash(struct nfsd_file *nf) 241 248 { 242 249 lockdep_assert_held(&nfsd_file_hashtbl[nf->nf_hashval].nfb_lock); ··· 302 295 void 303 296 nfsd_file_put(struct nfsd_file *nf) 304 297 { 305 - bool is_hashed; 306 - 307 298 set_bit(NFSD_FILE_REFERENCED, &nf->nf_flags); 308 - if (refcount_read(&nf->nf_ref) > 2 || !nf->nf_file) { 299 + if (test_bit(NFSD_FILE_HASHED, &nf->nf_flags) == 0) { 300 + nfsd_file_flush(nf); 309 301 nfsd_file_put_noref(nf); 310 - return; 302 + } else { 303 + nfsd_file_put_noref(nf); 304 + if (nf->nf_file) 305 + nfsd_file_schedule_laundrette(); 311 306 } 312 - 313 - filemap_flush(nf->nf_file->f_mapping); 314 - is_hashed = test_bit(NFSD_FILE_HASHED, &nf->nf_flags) != 0; 315 - nfsd_file_put_noref(nf); 316 - if (is_hashed) 317 - nfsd_file_schedule_laundrette(); 318 307 if (atomic_long_read(&nfsd_filecache_count) >= NFSD_FILE_LRU_LIMIT) 319 308 nfsd_file_gc(); 320 309 } ··· 331 328 while(!list_empty(dispose)) { 332 329 nf = list_first_entry(dispose, struct nfsd_file, nf_lru); 333 330 list_del(&nf->nf_lru); 331 + nfsd_file_flush(nf); 334 332 nfsd_file_put_noref(nf); 335 333 } 336 334 } ··· 345 341 while(!list_empty(dispose)) { 346 342 nf = list_first_entry(dispose, struct nfsd_file, nf_lru); 347 343 list_del(&nf->nf_lru); 344 + nfsd_file_flush(nf); 348 345 if (!refcount_dec_and_test(&nf->nf_ref)) 349 346 continue; 350 347 if (nfsd_file_free(nf))
+12 -12
fs/nfsd/nfs2acl.c
··· 249 249 int w; 250 250 251 251 if (!svcxdr_encode_stat(xdr, resp->status)) 252 - return 0; 252 + return false; 253 253 254 254 if (dentry == NULL || d_really_is_negative(dentry)) 255 - return 1; 255 + return true; 256 256 inode = d_inode(dentry); 257 257 258 258 if (!svcxdr_encode_fattr(rqstp, xdr, &resp->fh, &resp->stat)) 259 - return 0; 259 + return false; 260 260 if (xdr_stream_encode_u32(xdr, resp->mask) < 0) 261 - return 0; 261 + return false; 262 262 263 263 rqstp->rq_res.page_len = w = nfsacl_size( 264 264 (resp->mask & NFS_ACL) ? resp->acl_access : NULL, 265 265 (resp->mask & NFS_DFACL) ? resp->acl_default : NULL); 266 266 while (w > 0) { 267 267 if (!*(rqstp->rq_next_page++)) 268 - return 1; 268 + return true; 269 269 w -= PAGE_SIZE; 270 270 } 271 271 272 272 if (!nfs_stream_encode_acl(xdr, inode, resp->acl_access, 273 273 resp->mask & NFS_ACL, 0)) 274 - return 0; 274 + return false; 275 275 if (!nfs_stream_encode_acl(xdr, inode, resp->acl_default, 276 276 resp->mask & NFS_DFACL, NFS_ACL_DEFAULT)) 277 - return 0; 277 + return false; 278 278 279 - return 1; 279 + return true; 280 280 } 281 281 282 282 /* ACCESS */ ··· 286 286 struct nfsd3_accessres *resp = rqstp->rq_resp; 287 287 288 288 if (!svcxdr_encode_stat(xdr, resp->status)) 289 - return 0; 289 + return false; 290 290 switch (resp->status) { 291 291 case nfs_ok: 292 292 if (!svcxdr_encode_fattr(rqstp, xdr, &resp->fh, &resp->stat)) 293 - return 0; 293 + return false; 294 294 if (xdr_stream_encode_u32(xdr, resp->access) < 0) 295 - return 0; 295 + return false; 296 296 break; 297 297 } 298 298 299 - return 1; 299 + return true; 300 300 } 301 301 302 302 /*
+1
include/linux/sunrpc/svc.h
··· 395 395 size_t addrlen; 396 396 struct sockaddr_storage daddr; /* where reply must come from */ 397 397 size_t daddrlen; 398 + void *xprt_ctxt; 398 399 struct cache_deferred_req handle; 399 400 size_t xprt_hlen; 400 401 int argslen;
+4 -3
include/trace/events/sunrpc.h
··· 2015 2015 TP_STRUCT__entry( 2016 2016 __field(const void *, dr) 2017 2017 __field(u32, xid) 2018 - __string(addr, dr->xprt->xpt_remotebuf) 2018 + __array(__u8, addr, INET6_ADDRSTRLEN + 10) 2019 2019 ), 2020 2020 2021 2021 TP_fast_assign( 2022 2022 __entry->dr = dr; 2023 2023 __entry->xid = be32_to_cpu(*(__be32 *)(dr->args + 2024 2024 (dr->xprt_hlen>>2))); 2025 - __assign_str(addr, dr->xprt->xpt_remotebuf); 2025 + snprintf(__entry->addr, sizeof(__entry->addr) - 1, 2026 + "%pISpc", (struct sockaddr *)&dr->addr); 2026 2027 ), 2027 2028 2028 - TP_printk("addr=%s dr=%p xid=0x%08x", __get_str(addr), __entry->dr, 2029 + TP_printk("addr=%s dr=%p xid=0x%08x", __entry->addr, __entry->dr, 2029 2030 __entry->xid) 2030 2031 ); 2031 2032
+3
net/sunrpc/svc_xprt.c
··· 1231 1231 dr->daddr = rqstp->rq_daddr; 1232 1232 dr->argslen = rqstp->rq_arg.len >> 2; 1233 1233 dr->xprt_hlen = rqstp->rq_xprt_hlen; 1234 + dr->xprt_ctxt = rqstp->rq_xprt_ctxt; 1235 + rqstp->rq_xprt_ctxt = NULL; 1234 1236 1235 1237 /* back up head to the start of the buffer and copy */ 1236 1238 skip = rqstp->rq_arg.len - rqstp->rq_arg.head[0].iov_len; ··· 1271 1269 rqstp->rq_xprt_hlen = dr->xprt_hlen; 1272 1270 rqstp->rq_daddr = dr->daddr; 1273 1271 rqstp->rq_respages = rqstp->rq_pages; 1272 + rqstp->rq_xprt_ctxt = dr->xprt_ctxt; 1274 1273 svc_xprt_received(rqstp->rq_xprt); 1275 1274 return (dr->argslen<<2) - dr->xprt_hlen; 1276 1275 }
+1 -1
net/sunrpc/xprtrdma/svc_rdma_recvfrom.c
··· 831 831 goto out_err; 832 832 if (ret == 0) 833 833 goto out_drop; 834 - rqstp->rq_xprt_hlen = ret; 834 + rqstp->rq_xprt_hlen = 0; 835 835 836 836 if (svc_rdma_is_reverse_direction_reply(xprt, ctxt)) 837 837 goto out_backchannel;