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.

NFSv4: Fix an Oops in the synchronous write path

- Missing initialisation of attribute bitmask in _nfs4_proc_write()
- On success, _nfs4_proc_write() must return number of bytes written.
- Missing post_op_update_inode() in _nfs4_proc_write()
- Missing initialisation of attribute bitmask in _nfs4_proc_commit()
- Missing post_op_update_inode() in _nfs4_proc_commit()

Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>

+10 -1
+10 -1
fs/nfs/nfs4proc.c
··· 1506 1506 dprintk("NFS call write %d @ %Ld\n", wdata->args.count, 1507 1507 (long long) wdata->args.offset); 1508 1508 1509 + wdata->args.bitmask = server->attr_bitmask; 1510 + wdata->res.server = server; 1509 1511 nfs_fattr_init(fattr); 1510 1512 status = rpc_call_sync(server->client, &msg, rpcflags); 1511 1513 dprintk("NFS reply write: %d\n", status); 1512 - return status; 1514 + if (status < 0) 1515 + return status; 1516 + nfs_post_op_update_inode(inode, fattr); 1517 + return wdata->res.count; 1513 1518 } 1514 1519 1515 1520 static int nfs4_proc_write(struct nfs_write_data *wdata) ··· 1545 1540 dprintk("NFS call commit %d @ %Ld\n", cdata->args.count, 1546 1541 (long long) cdata->args.offset); 1547 1542 1543 + cdata->args.bitmask = server->attr_bitmask; 1544 + cdata->res.server = server; 1548 1545 nfs_fattr_init(fattr); 1549 1546 status = rpc_call_sync(server->client, &msg, 0); 1550 1547 dprintk("NFS reply commit: %d\n", status); 1548 + if (status >= 0) 1549 + nfs_post_op_update_inode(inode, fattr); 1551 1550 return status; 1552 1551 } 1553 1552