Skip to contentSkip to conversation

nilfs: fix unprotected super_block flags modification in nilfs_error

PATCH New Jiro SEKIBA 1 participant 1 message Feb 26, 2010 NILFS2 filesystem

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 nilfs: fix unprotected super_block flags modification in nilfs_error

Hi,

This is a trivial patch to protect super_block flags.

super_block flags must be protected by the proper semaphore when modifying it.

---
 fs/nilfs2/super.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)
fs/nilfs2/super.c +2 -0
index 8173fae..3ee02b8 100644
@@ -110,7 +110,9 @@ void nilfs_error(struct super_block *sb, const char *function,
 
 		if (nilfs_test_opt(sbi, ERRORS_RO)) {
 			printk(KERN_CRIT "Remounting filesystem read-only\n");
+			down_write(&nilfs->ns_super_sem);
 			sb->s_flags |= MS_RDONLY;
+			up_write(&nilfs->ns_super_sem);
 		}
 	}
 
Signature · 6 lines
1.5.6.5

--
To unsubscribe from this list: send the line "unsubscribe linux-nilfs" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html