summaryrefslogtreecommitdiff
path: root/fs/locks.c
diff options
context:
space:
mode:
authorMark Brown <broonie@kernel.org>2026-01-06 18:02:05 +0000
committerMark Brown <broonie@kernel.org>2026-01-06 18:02:05 +0000
commitf33db67d914a80ec449579dddc41804857c9400d (patch)
treec1d467fa39efde347ea27a9ffccfdb4be9962aab /fs/locks.c
parentfd9a14d233fbf33488cfa0cb7f59051b3233b017 (diff)
parent46a16d89d097ac2c93b63382a37d60aa7f21dc71 (diff)
downloadlinux-next-f33db67d914a80ec449579dddc41804857c9400d.tar.gz
linux-next-f33db67d914a80ec449579dddc41804857c9400d.zip
ASoC: codecs: wsa88xx: fix codec initialisation
Merge series from Johan Hovold <johan@kernel.org>: The soundwire update_status() callback may be called multiple times with the same ATTACHED status but initialisation should only be done when transitioning from UNATTACHED to ATTACHED. This series fixes the Qualcomm wsa88xx codec drivers that do unnecessary reinitialisation or potentially fail to initialise at all. Included is also a related clean up suppressing a related codec variant printk.
Diffstat (limited to 'fs/locks.c')
-rw-r--r--fs/locks.c12
1 files changed, 10 insertions, 2 deletions
diff --git a/fs/locks.c b/fs/locks.c
index 9f565802a88c..e2036aa4bd37 100644
--- a/fs/locks.c
+++ b/fs/locks.c
@@ -2236,13 +2236,21 @@ SYSCALL_DEFINE2(flock, unsigned int, fd, unsigned int, cmd)
/**
* vfs_test_lock - test file byte range lock
* @filp: The file to test lock for
- * @fl: The lock to test; also used to hold result
+ * @fl: The byte-range in the file to test; also used to hold result
*
+ * On entry, @fl does not contain a lock, but identifies a range (fl_start, fl_end)
+ * in the file (c.flc_file), and an owner (c.flc_owner) for whom existing locks
+ * should be ignored. c.flc_type and c.flc_flags are ignored.
+ * Both fl_lmops and fl_ops in @fl must be NULL.
* Returns -ERRNO on failure. Indicates presence of conflicting lock by
- * setting conf->fl_type to something other than F_UNLCK.
+ * setting fl->fl_type to something other than F_UNLCK.
+ *
+ * If vfs_test_lock() does find a lock and return it, the caller must
+ * use locks_free_lock() or locks_release_private() on the returned lock.
*/
int vfs_test_lock(struct file *filp, struct file_lock *fl)
{
+ WARN_ON_ONCE(fl->fl_ops || fl->fl_lmops);
WARN_ON_ONCE(filp != fl->c.flc_file);
if (filp->f_op->lock)
return filp->f_op->lock(filp, F_GETLK, fl);