linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] reiserfs: Fix locking in reiserfs_quota_on()
@ 2010-10-28  0:28 Jan Kara
  2010-10-28  0:47 ` Al Viro
  2010-10-28  1:36 ` Frederic Weisbecker
  0 siblings, 2 replies; 5+ messages in thread
From: Jan Kara @ 2010-10-28  0:28 UTC (permalink / raw)
  To: reiserfs-devel; +Cc: linux-fsdevel, Frederic Weisbecker, Jan Kara

reiserfs_quota_on() unpacks a tail of quota file in case it has one. But after
BKL conversion, reiserfs_unpack() expects to be called with write_lock held.
So acquire the lock before calling reiserfs_unpack() to avoid assertion
failures.

Reported-by: markus.gapp@gmx.net
Signed-off-by: Jan Kara <jack@suse.cz>
---
 fs/reiserfs/super.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

 Frederic, would you merge this patch or should I merge it?

diff --git a/fs/reiserfs/super.c b/fs/reiserfs/super.c
index 6e85cfd..73c000f 100644
--- a/fs/reiserfs/super.c
+++ b/fs/reiserfs/super.c
@@ -2059,7 +2059,9 @@ static int reiserfs_quota_on(struct super_block *sb, int type, int format_id,
 	inode = path->dentry->d_inode;
 	/* We must not pack tails for quota files on reiserfs for quota IO to work */
 	if (!(REISERFS_I(inode)->i_flags & i_nopack_mask)) {
+		reiserfs_write_lock(sb);
 		err = reiserfs_unpack(inode, NULL);
+		reiserfs_write_unlock(sb);
 		if (err) {
 			reiserfs_warning(sb, "super-6520",
 				"Unpacking tail of quota file failed"
-- 
1.7.1


^ permalink raw reply related	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2010-11-09 15:40 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-10-28  0:28 [PATCH] reiserfs: Fix locking in reiserfs_quota_on() Jan Kara
2010-10-28  0:47 ` Al Viro
2010-10-28  1:36 ` Frederic Weisbecker
2010-11-09 15:37   ` Jan Kara
2010-11-09 15:40     ` Frederic Weisbecker

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).