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 'locks-v4.19-1' of git://git.kernel.org/pub/scm/linux/kernel/git/jlayton/linux

Pull file locking updates from Jeff Layton:
"Just a couple of patches from Konstantin to fix /proc/locks when the
process that set the lock has exited, and a new tracepoint for the
flock() codepath. Also threw in mailmap entries for my addresses and a
comment cleanup"

* tag 'locks-v4.19-1' of git://git.kernel.org/pub/scm/linux/kernel/git/jlayton/linux:
locks: remove misleading obsolete comment
mailmap: remap some of my email addresses to kernel.org address
locks: add tracepoint in flock codepath
fs/lock: show locks taken by processes from another pidns
fs/lock: skip lock owner pid translation in case we are in init_pid_ns

+18 -10
+3
.mailmap
··· 81 81 <javier@osg.samsung.com> <javier.martinez@collabora.co.uk> 82 82 Jean Tourrilhes <jt@hpl.hp.com> 83 83 Jeff Garzik <jgarzik@pretzel.yyz.us> 84 + Jeff Layton <jlayton@kernel.org> <jlayton@redhat.com> 85 + Jeff Layton <jlayton@kernel.org> <jlayton@poochiereds.net> 86 + Jeff Layton <jlayton@kernel.org> <jlayton@primarydata.com> 84 87 Jens Axboe <axboe@suse.de> 85 88 Jens Osterkamp <Jens.Osterkamp@de.ibm.com> 86 89 Johan Hovold <johan@kernel.org> <jhovold@gmail.com>
+11 -9
fs/locks.c
··· 202 202 * we often hold the flc_lock as well. In certain cases, when reading the fields 203 203 * protected by this lock, we can skip acquiring it iff we already hold the 204 204 * flc_lock. 205 - * 206 - * In particular, adding an entry to the fl_block list requires that you hold 207 - * both the flc_lock and the blocked_lock_lock (acquired in that order). 208 - * Deleting an entry from the list however only requires the file_lock_lock. 209 205 */ 210 206 static DEFINE_SPINLOCK(blocked_lock_lock); 211 207 ··· 986 990 if (new_fl) 987 991 locks_free_lock(new_fl); 988 992 locks_dispose_list(&dispose); 993 + trace_flock_lock_inode(inode, request, error); 989 994 return error; 990 995 } 991 996 ··· 2069 2072 return -1; 2070 2073 if (IS_REMOTELCK(fl)) 2071 2074 return fl->fl_pid; 2075 + /* 2076 + * If the flock owner process is dead and its pid has been already 2077 + * freed, the translation below won't work, but we still want to show 2078 + * flock owner pid number in init pidns. 2079 + */ 2080 + if (ns == &init_pid_ns) 2081 + return (pid_t)fl->fl_pid; 2072 2082 2073 2083 rcu_read_lock(); 2074 2084 pid = find_pid_ns(fl->fl_pid, &init_pid_ns); ··· 2630 2626 2631 2627 fl_pid = locks_translate_pid(fl, proc_pidns); 2632 2628 /* 2633 - * If there isn't a fl_pid don't display who is waiting on 2634 - * the lock if we are called from locks_show, or if we are 2635 - * called from __show_fd_info - skip lock entirely 2629 + * If lock owner is dead (and pid is freed) or not visible in current 2630 + * pidns, zero is shown as a pid value. Check lock info from 2631 + * init_pid_ns to get saved lock pid value. 2636 2632 */ 2637 - if (fl_pid == 0) 2638 - return; 2639 2633 2640 2634 if (fl->fl_file != NULL) 2641 2635 inode = locks_inode(fl->fl_file);
+4 -1
include/trace/events/filelock.h
··· 112 112 TP_PROTO(struct inode *inode, struct file_lock *fl, int ret), 113 113 TP_ARGS(inode, fl, ret)); 114 114 115 - DECLARE_EVENT_CLASS(filelock_lease, 115 + DEFINE_EVENT(filelock_lock, flock_lock_inode, 116 + TP_PROTO(struct inode *inode, struct file_lock *fl, int ret), 117 + TP_ARGS(inode, fl, ret)); 116 118 119 + DECLARE_EVENT_CLASS(filelock_lease, 117 120 TP_PROTO(struct inode *inode, struct file_lock *fl), 118 121 119 122 TP_ARGS(inode, fl),