Thread (29 messages) 29 messages, 3 authors, 2012-03-06
STALE5257d

[PATCH RT 17/25][RFC 3.0.23-rt39-rc1] fs: Protect open coded isize seqcount

From: Steven Rostedt <rostedt@goodmis.org>
Date: 2012-03-06 16:20:08
Also in: lkml
Subsystem: filesystems (vfs and infrastructure), the rest · Maintainers: Alexander Viro, Christian Brauner, Linus Torvalds

From: Thomas Gleixner <redacted>

A writer might be preempted in the write side critical section on
RT. Disable preemption to avoid endless spinning of a preempting
reader.

Signed-off-by: Thomas Gleixner <redacted>
Cc: stable-rt@vger.kernel.org
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
---
 include/linux/fs.h |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)
diff --git a/include/linux/fs.h b/include/linux/fs.h
index 9c85217..c7984a5 100644
--- a/include/linux/fs.h
+++ b/include/linux/fs.h
@@ -876,9 +876,11 @@ static inline loff_t i_size_read(const struct inode *inode)
 static inline void i_size_write(struct inode *inode, loff_t i_size)
 {
 #if BITS_PER_LONG==32 && defined(CONFIG_SMP)
+	preempt_disable_rt();
 	write_seqcount_begin(&inode->i_size_seqcount);
 	inode->i_size = i_size;
 	write_seqcount_end(&inode->i_size_seqcount);
+	preempt_enable_rt();
 #elif BITS_PER_LONG==32 && defined(CONFIG_PREEMPT)
 	preempt_disable();
 	inode->i_size = i_size;
-- 
1.7.8.3
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help