Signed-off-by: Andrew Morton <akpm@osdl.org>
---

 25-akpm/fs/ext3/super.c |   15 +++++++++++----
 1 files changed, 11 insertions(+), 4 deletions(-)

diff -puN fs/ext3/super.c~fix-of-quota-deadlock-on-pagelock-ext3-tweaks fs/ext3/super.c
--- 25/fs/ext3/super.c~fix-of-quota-deadlock-on-pagelock-ext3-tweaks	2004-11-30 01:23:17.001182536 -0800
+++ 25-akpm/fs/ext3/super.c	2004-11-30 01:23:17.005181928 -0800
@@ -2380,8 +2380,10 @@ static ssize_t ext3_quota_read(struct su
 			       size_t len, loff_t off)
 {
 	struct inode *inode = sb_dqopt(sb)->files[type];
-	unsigned long blk = off >> EXT3_BLOCK_SIZE_BITS(sb);
-	int err = 0, offset = off & (sb->s_blocksize - 1), tocopy;
+	sector_t blk = off >> EXT3_BLOCK_SIZE_BITS(sb);
+	int err = 0;
+	int offset = off & (sb->s_blocksize - 1);
+	int tocopy;
 	size_t toread;
 	struct buffer_head *bh;
 	loff_t i_size = i_size_read(inode);
@@ -2416,8 +2418,10 @@ static ssize_t ext3_quota_write(struct s
 				const char *data, size_t len, loff_t off)
 {
 	struct inode *inode = sb_dqopt(sb)->files[type];
-	unsigned long blk = off >> EXT3_BLOCK_SIZE_BITS(sb);
-	int err = 0, offset = off & (sb->s_blocksize - 1), tocopy;
+	sector_t blk = off >> EXT3_BLOCK_SIZE_BITS(sb);
+	int err = 0;
+	int offset = off & (sb->s_blocksize - 1);
+	int tocopy;
 	int journal_quota = EXT3_SB(sb)->s_qf_names[type] != NULL;
 	size_t towrite = len;
 	struct buffer_head *bh;
@@ -2437,7 +2441,10 @@ static ssize_t ext3_quota_write(struct s
 				goto out;
 			}
 		}
+		lock_buffer(bh);
 		memcpy(bh->b_data+offset, data, tocopy);
+		flush_dcache_page(bh->b_page);
+		unlock_buffer(bh);
 		if (journal_quota)
 			err = ext3_journal_dirty_metadata(handle, bh);
 		else {
_