From 722b57bce240f1fde7f8fb6f6bdc0e621273dc22 Mon Sep 17 00:00:00 2001 From: Namjae Jeon Date: Wed, 10 Oct 2012 00:09:12 +0900 Subject: [PATCH] --- yaml --- r: 345679 b: refs/heads/master c: fb719c59bdb4fca86ee1fd1f42ab3735ca12b6b2 h: refs/heads/master i: 345677: af57ae0f016d93a6df9179550b569e26b35c1661 345675: 384953f75b5e59fa289df23fd7e544f5268b2629 345671: 2547e21263c46f79ef868deff2a0d99d0336854a 345663: 6245e8ee5d457d233fb72a46eebf244ed11eb71d v: v3 --- [refs] | 2 +- trunk/fs/udf/inode.c | 7 +++++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/[refs] b/[refs] index bedf11a31985..ad9fd05647c0 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 2fb7d99d0de3fd8ae869f35ab682581d8455887a +refs/heads/master: fb719c59bdb4fca86ee1fd1f42ab3735ca12b6b2 diff --git a/trunk/fs/udf/inode.c b/trunk/fs/udf/inode.c index 2b7759371ff6..8266f2ed7fc4 100644 --- a/trunk/fs/udf/inode.c +++ b/trunk/fs/udf/inode.c @@ -601,6 +601,7 @@ static sector_t inode_getblk(struct inode *inode, sector_t block, struct udf_inode_info *iinfo = UDF_I(inode); int goal = 0, pgoal = iinfo->i_location.logicalBlockNum; int lastblock = 0; + bool isBeyondEOF; *err = 0; *new = 0; @@ -680,7 +681,7 @@ static sector_t inode_getblk(struct inode *inode, sector_t block, /* Are we beyond EOF? */ if (etype == -1) { int ret; - + isBeyondEOF = 1; if (count) { if (c) laarr[0] = laarr[1]; @@ -723,6 +724,7 @@ static sector_t inode_getblk(struct inode *inode, sector_t block, endnum = c + 1; lastblock = 1; } else { + isBeyondEOF = 0; endnum = startnum = ((count > 2) ? 2 : count); /* if the current extent is in position 0, @@ -770,7 +772,8 @@ static sector_t inode_getblk(struct inode *inode, sector_t block, *err = -ENOSPC; return 0; } - iinfo->i_lenExtents += inode->i_sb->s_blocksize; + if (isBeyondEOF) + iinfo->i_lenExtents += inode->i_sb->s_blocksize; } /* if the extent the requsted block is located in contains multiple