32 lines
1.0 KiB
Diff
32 lines
1.0 KiB
Diff
Subject: fs: Protect open coded isize seqcount
|
|
From: Thomas Gleixner <tglx@linutronix.de>
|
|
Date: Thu, 01 Mar 2012 16:12:47 +0100
|
|
|
|
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 <tglx@linutronix.de>
|
|
Cc: stable-rt@vger.kernel.org
|
|
|
|
---
|
|
include/linux/fs.h | 2 ++
|
|
1 file changed, 2 insertions(+)
|
|
|
|
Index: linux-3.2/include/linux/fs.h
|
|
===================================================================
|
|
--- linux-3.2.orig/include/linux/fs.h
|
|
+++ linux-3.2/include/linux/fs.h
|
|
@@ -903,9 +903,11 @@ static inline loff_t i_size_read(const s
|
|
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;
|