lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Date:   Mon, 19 Feb 2018 17:20:29 +0200
From:   Nikolay Borisov <nborisov@...e.com>
To:     viro@...iv.linux.org.uk
Cc:     linux-fsdevel@...r.kernel.org, linux-kernel@...r.kernel.org,
        axboe@...com, Nikolay Borisov <nborisov@...e.com>
Subject: [PATCH] fs: Improve comment of inode_dio_begin

Firstly, the description of the function was a direct copy/paste of
inode_dio_end and as such made no sense. So rewrite it to correctly
state this is used before starting an io. Also document the locking
requirements, since currently one has to look at the definition of
inode_dio_wait to see the requirement of a lock being held while
bumping i_dio_count.

Signed-off-by: Nikolay Borisov <nborisov@...e.com>
---
 include/linux/fs.h | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/include/linux/fs.h b/include/linux/fs.h
index 511fbaabf624..90ac851930ae 100644
--- a/include/linux/fs.h
+++ b/include/linux/fs.h
@@ -3015,8 +3015,10 @@ void inode_dio_wait(struct inode *inode);
  * inode_dio_begin - signal start of a direct I/O requests
  * @inode: inode the direct I/O happens on
  *
- * This is called once we've finished processing a direct I/O request,
- * and is used to wake up callers waiting for direct I/O to be quiesced.
+ * This is called before we begin processing a direct I/O request,
+ * and is used to quiesce callers of inode_dio_wait. It must be
+ * called under a lock that serialising getting a reference to
+ * ->i_dio_count (usually the inode_lock)
  */
 static inline void inode_dio_begin(struct inode *inode)
 {
-- 
2.7.4

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ