diff mbox series

[v3,1/3] vfs: add the sb_start_intwrite_trylock() helper

Message ID 1524495608-14086-2-git-send-email-amir73il@gmail.com
State Accepted, archived
Headers show
Series Fix ext4 freeze protection bypass | expand

Commit Message

Amir Goldstein April 23, 2018, 3 p.m. UTC
Needed by ext4 to test frozen fs before updating s_last_mounted.

Reviewed-by: Jan Kara <jack@suse.cz>
Signed-off-by: Amir Goldstein <amir73il@gmail.com>
---
 include/linux/fs.h | 5 +++++
 1 file changed, 5 insertions(+)

Comments

Theodore Ts'o May 14, 2018, 2:42 a.m. UTC | #1
On Mon, Apr 23, 2018 at 09:00:06AM -0600, Amir Goldstein wrote:
> Needed by ext4 to test frozen fs before updating s_last_mounted.
> 
> Reviewed-by: Jan Kara <jack@suse.cz>
> Signed-off-by: Amir Goldstein <amir73il@gmail.com>

Applied, thanks.

					- Ted
diff mbox series

Patch

diff --git a/include/linux/fs.h b/include/linux/fs.h
index 760d8da1b6c7..cac41f1bad05 100644
--- a/include/linux/fs.h
+++ b/include/linux/fs.h
@@ -1597,6 +1597,11 @@  static inline void sb_start_intwrite(struct super_block *sb)
 	__sb_start_write(sb, SB_FREEZE_FS, true);
 }
 
+static inline int sb_start_intwrite_trylock(struct super_block *sb)
+{
+	return __sb_start_write(sb, SB_FREEZE_FS, false);
+}
+
 
 extern bool inode_owner_or_capable(const struct inode *inode);