[ 3.5.y.z extended stable ] Patch "udf: don't increment lenExtents while writing to a hole" has been added to staging queue
Herton Ronaldo Krzesinski
herton.krzesinski at canonical.com
Thu Jan 10 02:39:51 UTC 2013
This is a note to let you know that I have just added a patch titled
udf: don't increment lenExtents while writing to a hole
to the linux-3.5.y-queue branch of the 3.5.y.z extended stable tree
which can be found at:
http://kernel.ubuntu.com/git?p=ubuntu/linux.git;a=shortlog;h=refs/heads/linux-3.5.y-queue
If you, or anyone else, feels it should not be added to this tree, please
reply to this email.
For more information about the 3.5.y.z tree, see
https://wiki.ubuntu.com/Kernel/Dev/ExtendedStable
Thanks.
-Herton
------
>From e985ea0f54370e021043016263dba801d9a9d0cd Mon Sep 17 00:00:00 2001
From: Namjae Jeon <namjae.jeon at samsung.com>
Date: Wed, 10 Oct 2012 00:09:12 +0900
Subject: [PATCH] udf: don't increment lenExtents while writing to a hole
commit fb719c59bdb4fca86ee1fd1f42ab3735ca12b6b2 upstream.
Incrementing lenExtents even while writing to a hole is bad
for performance as calls to udf_discard_prealloc and
udf_truncate_tail_extent would not return from start if
isize != lenExtents
Signed-off-by: Namjae Jeon <namjae.jeon at samsung.com>
Signed-off-by: Ashish Sangwan <a.sangwan at samsung.com>
Signed-off-by: Jan Kara <jack at suse.cz>
Signed-off-by: Herton Ronaldo Krzesinski <herton.krzesinski at canonical.com>
---
fs/udf/inode.c | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)
diff --git a/fs/udf/inode.c b/fs/udf/inode.c
index 8873c47..fb65df5 100644
--- a/fs/udf/inode.c
+++ b/fs/udf/inode.c
@@ -574,6 +574,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;
@@ -653,7 +654,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];
@@ -696,6 +697,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,
@@ -743,7 +745,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
--
1.7.9.5
More information about the kernel-team
mailing list