Commit 7e8e5cc
committed
filelock: WARN_ON_ONCE when ->fl_file and filp don't match
vfs_lock_file, vfs_test_lock and vfs_cancel_lock all take both a struct
file argument and a file_lock. The file_lock has a fl_file field in it
howevever and it _must_ match the file passed in.
While most of the locks.c routines use the separately-passed file
argument, some filesystems rely on fl_file being filled out correctly.
I'm working on a patch series to remove the redundant argument from
these routines, but for now, let's ensure that the callers always set
this properly by issuing a WARN_ON_ONCE if they ever don't match.
Cc: Chuck Lever <[email protected]>
Cc: Trond Myklebust <[email protected]>
Signed-off-by: Jeff Layton <[email protected]>1 parent 094226a commit 7e8e5cc
1 file changed
+3
-0
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2146 | 2146 | | |
2147 | 2147 | | |
2148 | 2148 | | |
| 2149 | + | |
2149 | 2150 | | |
2150 | 2151 | | |
2151 | 2152 | | |
| |||
2295 | 2296 | | |
2296 | 2297 | | |
2297 | 2298 | | |
| 2299 | + | |
2298 | 2300 | | |
2299 | 2301 | | |
2300 | 2302 | | |
| |||
2663 | 2665 | | |
2664 | 2666 | | |
2665 | 2667 | | |
| 2668 | + | |
2666 | 2669 | | |
2667 | 2670 | | |
2668 | 2671 | | |
| |||
0 commit comments