Skip to content

Commit 7648229

Browse files
committed
Merge tag 'nfsd-6.2' of git://git.kernel.org/pub/scm/linux/kernel/git/cel/linux
Pull nfsd updates from Chuck Lever: "This release introduces support for the CB_RECALL_ANY operation. NFSD can send this operation to request that clients return any delegations they choose. The server uses this operation to handle low memory scenarios or indicate to a client when that client has reached the maximum number of delegations the server supports. The NFSv4.2 READ_PLUS operation has been simplified temporarily whilst support for sparse files in local filesystems and the VFS is improved. Two major data structure fixes appear in this release: - The nfs4_file hash table is replaced with a resizable hash table to reduce the latency of NFSv4 OPEN operations. - Reference counting in the NFSD filecache has been hardened against races. In furtherance of removing support for NFSv2 in a subsequent kernel release, a new Kconfig option enables server-side support for NFSv2 to be left out of a kernel build. MAINTAINERS has been updated to indicate that changes to fs/exportfs should go through the NFSD tree" * tag 'nfsd-6.2' of git://git.kernel.org/pub/scm/linux/kernel/git/cel/linux: (49 commits) NFSD: Avoid clashing function prototypes SUNRPC: Fix crasher in unwrap_integ_data() SUNRPC: Make the svc_authenticate tracepoint conditional NFSD: Use only RQ_DROPME to signal the need to drop a reply SUNRPC: Clean up xdr_write_pages() SUNRPC: Don't leak netobj memory when gss_read_proxy_verf() fails NFSD: add CB_RECALL_ANY tracepoints NFSD: add delegation reaper to react to low memory condition NFSD: add support for sending CB_RECALL_ANY NFSD: refactoring courtesy_client_reaper to a generic low memory shrinker trace: Relocate event helper files NFSD: pass range end to vfs_fsync_range() instead of count lockd: fix file selection in nlmsvc_cancel_blocked lockd: ensure we use the correct file descriptor when unlocking lockd: set missing fl_flags field when retrieving args NFSD: Use struct_size() helper in alloc_session() nfsd: return error if nfs4_setacl fails lockd: set other missing fields when unlocking files NFSD: Add an nfsd_file_fsync tracepoint sunrpc: svc: Remove an unused static function svc_ungetu32() ...
2 parents 149c51f + e78e274 commit 7648229

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

49 files changed

+1300
-806
lines changed

MAINTAINERS

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10082,6 +10082,7 @@ F: drivers/infiniband/
1008210082
F: include/rdma/
1008310083
F: include/trace/events/ib_mad.h
1008410084
F: include/trace/events/ib_umad.h
10085+
F: include/trace/misc/rdma.h
1008510086
F: include/uapi/linux/if_infiniband.h
1008610087
F: include/uapi/rdma/
1008710088
F: samples/bpf/ibumad_kern.c
@@ -11168,11 +11169,18 @@ L: [email protected]
1116811169
S: Supported
1116911170
W: http://nfs.sourceforge.net/
1117011171
T: git git://git.kernel.org/pub/scm/linux/kernel/git/cel/linux.git
11172+
F: fs/exportfs/
1117111173
F: fs/lockd/
1117211174
F: fs/nfs_common/
1117311175
F: fs/nfsd/
1117411176
F: include/linux/lockd/
1117511177
F: include/linux/sunrpc/
11178+
F: include/trace/events/rpcgss.h
11179+
F: include/trace/events/rpcrdma.h
11180+
F: include/trace/events/sunrpc.h
11181+
F: include/trace/misc/fs.h
11182+
F: include/trace/misc/nfs.h
11183+
F: include/trace/misc/sunrpc.h
1117611184
F: include/uapi/linux/nfsd/
1117711185
F: include/uapi/linux/sunrpc/
1117811186
F: net/sunrpc/

drivers/infiniband/core/cm_trace.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616

1717
#include <linux/tracepoint.h>
1818
#include <rdma/ib_cm.h>
19-
#include <trace/events/rdma.h>
19+
#include <trace/misc/rdma.h>
2020

2121
/*
2222
* enum ib_cm_state, from include/rdma/ib_cm.h

drivers/infiniband/core/cma_trace.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
#define _TRACE_RDMA_CMA_H
1616

1717
#include <linux/tracepoint.h>
18-
#include <trace/events/rdma.h>
18+
#include <trace/misc/rdma.h>
1919

2020

2121
DECLARE_EVENT_CLASS(cma_fsm_class,

fs/exportfs/expfs.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
#include <linux/sched.h>
1919
#include <linux/cred.h>
2020

21-
#define dprintk(fmt, args...) do{}while(0)
21+
#define dprintk(fmt, args...) pr_debug(fmt, ##args)
2222

2323

2424
static int get_name(const struct path *path, char *name, struct dentry *child);
@@ -132,8 +132,8 @@ static struct dentry *reconnect_one(struct vfsmount *mnt,
132132
inode_unlock(dentry->d_inode);
133133

134134
if (IS_ERR(parent)) {
135-
dprintk("%s: get_parent of %ld failed, err %d\n",
136-
__func__, dentry->d_inode->i_ino, PTR_ERR(parent));
135+
dprintk("get_parent of %lu failed, err %ld\n",
136+
dentry->d_inode->i_ino, PTR_ERR(parent));
137137
return parent;
138138
}
139139

@@ -147,7 +147,7 @@ static struct dentry *reconnect_one(struct vfsmount *mnt,
147147
dprintk("%s: found name: %s\n", __func__, nbuf);
148148
tmp = lookup_one_unlocked(mnt_user_ns(mnt), nbuf, parent, strlen(nbuf));
149149
if (IS_ERR(tmp)) {
150-
dprintk("%s: lookup failed: %d\n", __func__, PTR_ERR(tmp));
150+
dprintk("lookup failed: %ld\n", PTR_ERR(tmp));
151151
err = PTR_ERR(tmp);
152152
goto out_err;
153153
}

fs/lockd/svc4proc.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@ nlm4svc_retrieve_args(struct svc_rqst *rqstp, struct nlm_args *argp,
5252
*filp = file;
5353

5454
/* Set up the missing parts of the file_lock structure */
55+
lock->fl.fl_flags = FL_POSIX;
5556
lock->fl.fl_file = file->f_file[mode];
5657
lock->fl.fl_pid = current->tgid;
5758
lock->fl.fl_start = (loff_t)lock->lock_start;

fs/lockd/svclock.c

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -659,11 +659,13 @@ nlmsvc_unlock(struct net *net, struct nlm_file *file, struct nlm_lock *lock)
659659
nlmsvc_cancel_blocked(net, file, lock);
660660

661661
lock->fl.fl_type = F_UNLCK;
662-
if (file->f_file[O_RDONLY])
663-
error = vfs_lock_file(file->f_file[O_RDONLY], F_SETLK,
662+
lock->fl.fl_file = file->f_file[O_RDONLY];
663+
if (lock->fl.fl_file)
664+
error = vfs_lock_file(lock->fl.fl_file, F_SETLK,
664665
&lock->fl, NULL);
665-
if (file->f_file[O_WRONLY])
666-
error = vfs_lock_file(file->f_file[O_WRONLY], F_SETLK,
666+
lock->fl.fl_file = file->f_file[O_WRONLY];
667+
if (lock->fl.fl_file)
668+
error |= vfs_lock_file(lock->fl.fl_file, F_SETLK,
667669
&lock->fl, NULL);
668670

669671
return (error < 0)? nlm_lck_denied_nolocks : nlm_granted;
@@ -697,9 +699,10 @@ nlmsvc_cancel_blocked(struct net *net, struct nlm_file *file, struct nlm_lock *l
697699
block = nlmsvc_lookup_block(file, lock);
698700
mutex_unlock(&file->f_mutex);
699701
if (block != NULL) {
700-
mode = lock_to_openmode(&lock->fl);
701-
vfs_cancel_lock(block->b_file->f_file[mode],
702-
&block->b_call->a_args.lock.fl);
702+
struct file_lock *fl = &block->b_call->a_args.lock.fl;
703+
704+
mode = lock_to_openmode(fl);
705+
vfs_cancel_lock(block->b_file->f_file[mode], fl);
703706
status = nlmsvc_unlink_block(block);
704707
nlmsvc_release_block(block);
705708
}

fs/lockd/svcproc.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,7 @@ nlmsvc_retrieve_args(struct svc_rqst *rqstp, struct nlm_args *argp,
7777

7878
/* Set up the missing parts of the file_lock structure */
7979
mode = lock_to_openmode(&lock->fl);
80+
lock->fl.fl_flags = FL_POSIX;
8081
lock->fl.fl_file = file->f_file[mode];
8182
lock->fl.fl_pid = current->tgid;
8283
lock->fl.fl_lmops = &nlmsvc_lock_operations;

fs/lockd/svcsubs.c

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -176,20 +176,23 @@ nlm_delete_file(struct nlm_file *file)
176176
}
177177
}
178178

179-
static int nlm_unlock_files(struct nlm_file *file, fl_owner_t owner)
179+
static int nlm_unlock_files(struct nlm_file *file, const struct file_lock *fl)
180180
{
181181
struct file_lock lock;
182182

183183
locks_init_lock(&lock);
184184
lock.fl_type = F_UNLCK;
185185
lock.fl_start = 0;
186186
lock.fl_end = OFFSET_MAX;
187-
lock.fl_owner = owner;
188-
if (file->f_file[O_RDONLY] &&
189-
vfs_lock_file(file->f_file[O_RDONLY], F_SETLK, &lock, NULL))
187+
lock.fl_owner = fl->fl_owner;
188+
lock.fl_pid = fl->fl_pid;
189+
lock.fl_flags = FL_POSIX;
190+
191+
lock.fl_file = file->f_file[O_RDONLY];
192+
if (lock.fl_file && vfs_lock_file(lock.fl_file, F_SETLK, &lock, NULL))
190193
goto out_err;
191-
if (file->f_file[O_WRONLY] &&
192-
vfs_lock_file(file->f_file[O_WRONLY], F_SETLK, &lock, NULL))
194+
lock.fl_file = file->f_file[O_WRONLY];
195+
if (lock.fl_file && vfs_lock_file(lock.fl_file, F_SETLK, &lock, NULL))
193196
goto out_err;
194197
return 0;
195198
out_err:
@@ -226,7 +229,7 @@ nlm_traverse_locks(struct nlm_host *host, struct nlm_file *file,
226229
if (match(lockhost, host)) {
227230

228231
spin_unlock(&flctx->flc_lock);
229-
if (nlm_unlock_files(file, fl->fl_owner))
232+
if (nlm_unlock_files(file, fl))
230233
return 1;
231234
goto again;
232235
}

fs/nfs/nfs4trace.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,10 @@
99
#define _TRACE_NFS4_H
1010

1111
#include <linux/tracepoint.h>
12-
#include <trace/events/sunrpc_base.h>
12+
#include <trace/misc/sunrpc.h>
1313

14-
#include <trace/events/fs.h>
15-
#include <trace/events/nfs.h>
14+
#include <trace/misc/fs.h>
15+
#include <trace/misc/nfs.h>
1616

1717
#define show_nfs_fattr_flags(valid) \
1818
__print_flags((unsigned long)valid, "|", \

fs/nfs/nfstrace.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,9 @@
1111
#include <linux/tracepoint.h>
1212
#include <linux/iversion.h>
1313

14-
#include <trace/events/fs.h>
15-
#include <trace/events/nfs.h>
16-
#include <trace/events/sunrpc_base.h>
14+
#include <trace/misc/fs.h>
15+
#include <trace/misc/nfs.h>
16+
#include <trace/misc/sunrpc.h>
1717

1818
#define nfs_show_cache_validity(v) \
1919
__print_flags(v, "|", \

0 commit comments

Comments
 (0)