Skip to contentSkip to conversation

ext2: Mark the buffer as unmapped before reading the next quota block

PATCH In review Manish Katiyar 2 participants 3 messages Feb 2, 2009 ext2 file system

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 ext2: Mark the buffer as unmapped before reading the next quota block

Hi Jan,

This is in continuation with the previous patch
(http://patchwork.ozlabs.org/patch/20275/) . We also need to set the buffer as unmapped before reading the next block. I don't think quota files can have holes, but atleast for correctness, otherwise once we have read a block, tmp_bh is always mapped even for holes.

---
 fs/ext2/super.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)
fs/ext2/super.c +0 -0
index da8bdea..b4e7633 100644
@@ -1328,6 +1328,7 @@ static ssize_t ext2_quota_read(struct

super_block *sb, int type, char *data,
sb->s_blocksize - offset : toread;

tmp_bh.b_state = 0;
+ clear_buffer_mapped(&tmp_bh);
err = ext2_get_block(inode, blk, &tmp_bh, 0); if (err < 0)
return err;

Signature · 5 lines
1.5.4.3


Thanks -
Manish
#1 lore raw
Quoted 19 lines · Manish Katiyar

Hi Jan,

This is in continuation with the previous patch
(http://patchwork.ozlabs.org/patch/20275/) . We also need to set the buffer as unmapped before reading the next block. I don't think quota files can have holes, but atleast for correctness, otherwise once we have read a block, tmp_bh is always mapped even for holes.

---
 fs/ext2/super.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)
fs/ext2/super.c +0 -0
index da8bdea..b4e7633 100644

fs/ext2/super.c static ssize_t ext2_quota_read(struct · line 1332

Quoted 5 lines
fs/ext2/super.c +1 -0
@@ -1328,6 +1328,7 @@ static ssize_t ext2_quota_read(struct
 super_block *sb, int type, char *data,
 				sb->s_blocksize - offset : toread;
 
 		tmp_bh.b_state = 0;
+		clear_buffer_mapped(&tmp_bh);

I don't get this. When b_state is 0, then in particuler the buffer is not
mapped. So why clear the mapped bit explicitely?

Quoted 3 lines
fs/ext2/super.c +0 -0
 		err = ext2_get_block(inode, blk, &tmp_bh, 0);
 		if (err < 0)

return err;

Honza

Signature · 2 lines
Jan Kara <[email protected]>
SUSE Labs, CR
#2 lore raw
Quoted 23 lines · Jan Kara
Quoted 22 lines · Manish Katiyar

Hi Jan,

This is in continuation with the previous patch
(http://patchwork.ozlabs.org/patch/20275/) . We also need to set the buffer as unmapped before reading the next block. I don't think quota files can have holes, but atleast for correctness, otherwise once we have read a block, tmp_bh is always mapped even for holes.

---
 fs/ext2/super.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)
fs/ext2/super.c +0 -0
index da8bdea..b4e7633 100644
@@ -1328,6 +1328,7 @@ static ssize_t ext2_quota_read(struct
 super_block *sb, int type, char *data,
                              sb->s_blocksize - offset : toread;
 
Quoted 4 lines

fs/ext2/super.c static ssize_t ext2_quota_read(struct · line 1332

Quoted 2 lines
fs/ext2/super.c +1 -0
              tmp_bh.b_state = 0;
+             clear_buffer_mapped(&tmp_bh);

I don't get this. When b_state is 0, then in particuler the buffer is not
mapped. So why clear the mapped bit explicitely?

Sorry for the noise.......my bad :-( !!

Thanks -
Manish

Quoted 10 lines
Quoted 4 lines
fs/ext2/super.c +0 -0
              err = ext2_get_block(inode, blk, &tmp_bh, 0);
              if (err < 0)
                      return err;

Honza
--
Jan Kara <[email protected]>
SUSE Labs, CR