Merge tag 'nfs-for-5.10-2' of git://git.linux-nfs.org/projects/anna/linux-nfs
Pull NFS client bugfixes from Anna Schumaker: "Stable fixes: - Fix failure to unregister shrinker Other fixes: - Fix unnecessary locking to clear up some contention - Fix listxattr receive buffer size - Fix default mount options for nfsroot" * tag 'nfs-for-5.10-2' of git://git.linux-nfs.org/projects/anna/linux-nfs: NFS: Remove unnecessary inode lock in nfs_fsync_dir() NFS: Remove unnecessary inode locking in nfs_llseek_dir() NFS: Fix listxattr receive buffer size NFSv4.2: fix failure to unregister shrinker nfsroot: Default mount option should ask for built-in NFS version
This commit is contained in:
15
fs/nfs/dir.c
15
fs/nfs/dir.c
@@ -955,7 +955,6 @@ out:
|
||||
|
||||
static loff_t nfs_llseek_dir(struct file *filp, loff_t offset, int whence)
|
||||
{
|
||||
struct inode *inode = file_inode(filp);
|
||||
struct nfs_open_dir_context *dir_ctx = filp->private_data;
|
||||
|
||||
dfprintk(FILE, "NFS: llseek dir(%pD2, %lld, %d)\n",
|
||||
@@ -967,15 +966,15 @@ static loff_t nfs_llseek_dir(struct file *filp, loff_t offset, int whence)
|
||||
case SEEK_SET:
|
||||
if (offset < 0)
|
||||
return -EINVAL;
|
||||
inode_lock(inode);
|
||||
spin_lock(&filp->f_lock);
|
||||
break;
|
||||
case SEEK_CUR:
|
||||
if (offset == 0)
|
||||
return filp->f_pos;
|
||||
inode_lock(inode);
|
||||
spin_lock(&filp->f_lock);
|
||||
offset += filp->f_pos;
|
||||
if (offset < 0) {
|
||||
inode_unlock(inode);
|
||||
spin_unlock(&filp->f_lock);
|
||||
return -EINVAL;
|
||||
}
|
||||
}
|
||||
@@ -987,7 +986,7 @@ static loff_t nfs_llseek_dir(struct file *filp, loff_t offset, int whence)
|
||||
dir_ctx->dir_cookie = 0;
|
||||
dir_ctx->duped = 0;
|
||||
}
|
||||
inode_unlock(inode);
|
||||
spin_unlock(&filp->f_lock);
|
||||
return offset;
|
||||
}
|
||||
|
||||
@@ -998,13 +997,9 @@ static loff_t nfs_llseek_dir(struct file *filp, loff_t offset, int whence)
|
||||
static int nfs_fsync_dir(struct file *filp, loff_t start, loff_t end,
|
||||
int datasync)
|
||||
{
|
||||
struct inode *inode = file_inode(filp);
|
||||
|
||||
dfprintk(FILE, "NFS: fsync dir(%pD2) datasync %d\n", filp, datasync);
|
||||
|
||||
inode_lock(inode);
|
||||
nfs_inc_stats(inode, NFSIOS_VFSFSYNC);
|
||||
inode_unlock(inode);
|
||||
nfs_inc_stats(file_inode(filp), NFSIOS_VFSFSYNC);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
@@ -1047,8 +1047,10 @@ out4:
|
||||
|
||||
void nfs4_xattr_cache_exit(void)
|
||||
{
|
||||
unregister_shrinker(&nfs4_xattr_large_entry_shrinker);
|
||||
unregister_shrinker(&nfs4_xattr_entry_shrinker);
|
||||
unregister_shrinker(&nfs4_xattr_cache_shrinker);
|
||||
list_lru_destroy(&nfs4_xattr_large_entry_lru);
|
||||
list_lru_destroy(&nfs4_xattr_entry_lru);
|
||||
list_lru_destroy(&nfs4_xattr_cache_lru);
|
||||
kmem_cache_destroy(nfs4_xattr_cache_cachep);
|
||||
|
||||
@@ -196,7 +196,7 @@
|
||||
1 + nfs4_xattr_name_maxsz + 1)
|
||||
#define decode_setxattr_maxsz (op_decode_hdr_maxsz + decode_change_info_maxsz)
|
||||
#define encode_listxattrs_maxsz (op_encode_hdr_maxsz + 2 + 1)
|
||||
#define decode_listxattrs_maxsz (op_decode_hdr_maxsz + 2 + 1 + 1)
|
||||
#define decode_listxattrs_maxsz (op_decode_hdr_maxsz + 2 + 1 + 1 + 1)
|
||||
#define encode_removexattr_maxsz (op_encode_hdr_maxsz + 1 + \
|
||||
nfs4_xattr_name_maxsz)
|
||||
#define decode_removexattr_maxsz (op_decode_hdr_maxsz + \
|
||||
@@ -531,7 +531,7 @@ static void encode_listxattrs(struct xdr_stream *xdr,
|
||||
{
|
||||
__be32 *p;
|
||||
|
||||
encode_op_hdr(xdr, OP_LISTXATTRS, decode_listxattrs_maxsz + 1, hdr);
|
||||
encode_op_hdr(xdr, OP_LISTXATTRS, decode_listxattrs_maxsz, hdr);
|
||||
|
||||
p = reserve_space(xdr, 12);
|
||||
if (unlikely(!p))
|
||||
|
||||
@@ -88,7 +88,13 @@
|
||||
#define NFS_ROOT "/tftpboot/%s"
|
||||
|
||||
/* Default NFSROOT mount options. */
|
||||
#if defined(CONFIG_NFS_V2)
|
||||
#define NFS_DEF_OPTIONS "vers=2,tcp,rsize=4096,wsize=4096"
|
||||
#elif defined(CONFIG_NFS_V3)
|
||||
#define NFS_DEF_OPTIONS "vers=3,tcp,rsize=4096,wsize=4096"
|
||||
#else
|
||||
#define NFS_DEF_OPTIONS "vers=4,tcp,rsize=4096,wsize=4096"
|
||||
#endif
|
||||
|
||||
/* Parameters passed from the kernel command line */
|
||||
static char nfs_root_parms[NFS_MAXPATHLEN + 1] __initdata = "";
|
||||
|
||||
Reference in New Issue
Block a user