Commit 200f9d21 authored by Linus Torvalds's avatar Linus Torvalds

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
parents af5043c8 11decaf8
...@@ -955,7 +955,6 @@ static int nfs_readdir(struct file *file, struct dir_context *ctx) ...@@ -955,7 +955,6 @@ static int nfs_readdir(struct file *file, struct dir_context *ctx)
static loff_t nfs_llseek_dir(struct file *filp, loff_t offset, int whence) 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; struct nfs_open_dir_context *dir_ctx = filp->private_data;
dfprintk(FILE, "NFS: llseek dir(%pD2, %lld, %d)\n", 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) ...@@ -967,15 +966,15 @@ static loff_t nfs_llseek_dir(struct file *filp, loff_t offset, int whence)
case SEEK_SET: case SEEK_SET:
if (offset < 0) if (offset < 0)
return -EINVAL; return -EINVAL;
inode_lock(inode); spin_lock(&filp->f_lock);
break; break;
case SEEK_CUR: case SEEK_CUR:
if (offset == 0) if (offset == 0)
return filp->f_pos; return filp->f_pos;
inode_lock(inode); spin_lock(&filp->f_lock);
offset += filp->f_pos; offset += filp->f_pos;
if (offset < 0) { if (offset < 0) {
inode_unlock(inode); spin_unlock(&filp->f_lock);
return -EINVAL; return -EINVAL;
} }
} }
...@@ -987,7 +986,7 @@ static loff_t nfs_llseek_dir(struct file *filp, loff_t offset, int whence) ...@@ -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->dir_cookie = 0;
dir_ctx->duped = 0; dir_ctx->duped = 0;
} }
inode_unlock(inode); spin_unlock(&filp->f_lock);
return offset; return offset;
} }
...@@ -998,13 +997,9 @@ static loff_t nfs_llseek_dir(struct file *filp, loff_t offset, int whence) ...@@ -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, static int nfs_fsync_dir(struct file *filp, loff_t start, loff_t end,
int datasync) int datasync)
{ {
struct inode *inode = file_inode(filp);
dfprintk(FILE, "NFS: fsync dir(%pD2) datasync %d\n", filp, datasync); dfprintk(FILE, "NFS: fsync dir(%pD2) datasync %d\n", filp, datasync);
inode_lock(inode); nfs_inc_stats(file_inode(filp), NFSIOS_VFSFSYNC);
nfs_inc_stats(inode, NFSIOS_VFSFSYNC);
inode_unlock(inode);
return 0; return 0;
} }
......
...@@ -1047,8 +1047,10 @@ int __init nfs4_xattr_cache_init(void) ...@@ -1047,8 +1047,10 @@ int __init nfs4_xattr_cache_init(void)
void nfs4_xattr_cache_exit(void) void nfs4_xattr_cache_exit(void)
{ {
unregister_shrinker(&nfs4_xattr_large_entry_shrinker);
unregister_shrinker(&nfs4_xattr_entry_shrinker); unregister_shrinker(&nfs4_xattr_entry_shrinker);
unregister_shrinker(&nfs4_xattr_cache_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_entry_lru);
list_lru_destroy(&nfs4_xattr_cache_lru); list_lru_destroy(&nfs4_xattr_cache_lru);
kmem_cache_destroy(nfs4_xattr_cache_cachep); kmem_cache_destroy(nfs4_xattr_cache_cachep);
......
...@@ -196,7 +196,7 @@ ...@@ -196,7 +196,7 @@
1 + nfs4_xattr_name_maxsz + 1) 1 + nfs4_xattr_name_maxsz + 1)
#define decode_setxattr_maxsz (op_decode_hdr_maxsz + decode_change_info_maxsz) #define decode_setxattr_maxsz (op_decode_hdr_maxsz + decode_change_info_maxsz)
#define encode_listxattrs_maxsz (op_encode_hdr_maxsz + 2 + 1) #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 + \ #define encode_removexattr_maxsz (op_encode_hdr_maxsz + 1 + \
nfs4_xattr_name_maxsz) nfs4_xattr_name_maxsz)
#define decode_removexattr_maxsz (op_decode_hdr_maxsz + \ #define decode_removexattr_maxsz (op_decode_hdr_maxsz + \
...@@ -531,7 +531,7 @@ static void encode_listxattrs(struct xdr_stream *xdr, ...@@ -531,7 +531,7 @@ static void encode_listxattrs(struct xdr_stream *xdr,
{ {
__be32 *p; __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); p = reserve_space(xdr, 12);
if (unlikely(!p)) if (unlikely(!p))
......
...@@ -88,7 +88,13 @@ ...@@ -88,7 +88,13 @@
#define NFS_ROOT "/tftpboot/%s" #define NFS_ROOT "/tftpboot/%s"
/* Default NFSROOT mount options. */ /* Default NFSROOT mount options. */
#if defined(CONFIG_NFS_V2)
#define NFS_DEF_OPTIONS "vers=2,tcp,rsize=4096,wsize=4096" #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 */ /* Parameters passed from the kernel command line */
static char nfs_root_parms[NFS_MAXPATHLEN + 1] __initdata = ""; static char nfs_root_parms[NFS_MAXPATHLEN + 1] __initdata = "";
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment