Skip to contentSkip to conversation

udf: update inode's iblock count when allocating new block

PATCH In review Namjae Jeon 2 participants 3 messages Oct 9, 2012 – Oct 12, 2012 UDF filesystem

lore
Share & tools
lore
#0 lore raw

PATCH 3/6 udf: update inode's iblock count when allocating new block

From: Namjae Jeon <[email protected]>

Currently, du will show wrong block count. This patch fix it.

---
 fs/udf/inode.c |    2 ++
 1 file changed, 2 insertions(+)
fs/udf/inode.c +2 -0
index 8266f2e..76a1f57 100644
@@ -775,6 +775,8 @@ static sector_t inode_getblk(struct inode *inode, sector_t block,
 		if (isBeyondEOF)
 			iinfo->i_lenExtents += inode->i_sb->s_blocksize;
 	}
+	/* update inode's iblocks */
+	inode->i_blocks += (1 << (inode->i_sb->s_blocksize_bits - 9));
 
 	/* if the extent the requsted block is located in contains multiple
 	 * blocks, split the extent into at most three extents. blocks prior
Signature · 1 line
1.7.9.5
#1 lore raw
Quoted 3 lines · Namjae Jeon

From: Namjae Jeon <[email protected]>

Currently, du will show wrong block count. This patch fix it.

This should be fixed by commit fd4287dbc07763595c1e74edbb6520092290185c.
Have you tested with newish kernel? If recent kernel still has an issue, can you provide a test case? Thanks!

Honza

Quoted 23 lines
---
 fs/udf/inode.c |    2 ++
 1 file changed, 2 insertions(+)
fs/udf/inode.c +2 -0
index 8266f2e..76a1f57 100644
@@ -775,6 +775,8 @@ static sector_t inode_getblk(struct inode *inode, sector_t block,
 		if (isBeyondEOF)
 			iinfo->i_lenExtents += inode->i_sb->s_blocksize;
 	}
+	/* update inode's iblocks */
+	inode->i_blocks += (1 << (inode->i_sb->s_blocksize_bits - 9));
 
 	/* if the extent the requsted block is located in contains multiple
 	 * blocks, split the extent into at most three extents. blocks prior
Signature · 1 line
1.7.9.5
Signature · 2 lines
Jan Kara <[email protected]>
SUSE Labs, CR
#2 lore raw

2012/10/12 Jan Kara <[email protected]>:

Quoted 7 lines · Namjae Jeon
Quoted 3 lines

From: Namjae Jeon <[email protected]>

Currently, du will show wrong block count. This patch fix it.

This should be fixed by commit fd4287dbc07763595c1e74edbb6520092290185c.
Have you tested with newish kernel? If recent kernel still has an issue, can you provide a test case? Thanks!

Hi. Jan.
You're right. There is no issue with latest kernel. Plz ignore this patch.
Thanks a lot!

Quoted 29 lines

Honza

Quoted 21 lines
---
 fs/udf/inode.c |    2 ++
 1 file changed, 2 insertions(+)
fs/udf/inode.c +2 -1
index 8266f2e..76a1f57 100644
@@ -775,6 +775,8 @@ static sector_t inode_getblk(struct inode *inode, sector_t block,
              if (isBeyondEOF)
                      iinfo->i_lenExtents += inode->i_sb->s_blocksize;
      }
+     /* update inode's iblocks */
+     inode->i_blocks += (1 << (inode->i_sb->s_blocksize_bits - 9));
 
      /* if the extent the requsted block is located in contains multiple
       * blocks, split the extent into at most three extents. blocks prior
--
Quoted 2 lines

1.7.9.5

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