mm/filemap.c: fix criteria of calling iov_shorten() in generic_file_direct_write()
PATCH 1/1 mm/filemap.c: fix criteria of calling iov_shorten() in generic_file_direct_write()
Quoted 11 lines · Gu Zheng
From
35947e6535d92c54cf523470cc8811e8b5fee3e5Mon Sep 17 00:00:00 2001
From: Gu Zheng <[email protected]>
Date: Tue, 23 Apr 2013 16:09:04 +0800
Subject: [PATCH]mm/filemap.c: fix criteria of callingiov_shorten()ingeneric_file_direct_write()
generic_file_direct_write()compares 'count'(the max count we actually can write) with 'ocount'(the count we request to write) to see if there is need to calliov_shorten()to reduce number of segments and the iovec's length. If the 'count' is equal or greater than 'ocount', there is no need to calliov_shorten()indeed. So the judgement should be changed:
'if (count != ocount)' --> 'if (count < ocount)'
Thanks for the patch but it shouldn't be really possible that count >
ocount, should it? So your patch doesn't really fix anything. Or am I missing something?
Honza
Quoted 27 lines
Signed-off-by Gu Zheng <[email protected]>--- mm/filemap.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)mm/filemap.c +1
-1@@ -2183,7 +2183,7 @@ generic_file_direct_write(struct kiocb *iocb, const struct iovec *iov,size_t write_len;pgoff_t end; -if (count != ocount) +if (count < ocount) *nr_segs =iov_shorten ((struct iovec *)iov, *nr_segs, count); write_len =iov_length (iov, *nr_segs);Signature · 7 lines
1.7.7 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Signature · 8 lines
Jan Kara <[email protected]> SUSE Labs, CR -- To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to [email protected]. For more info on Linux MM, see: http://www.linux-mm.org/ . Don't email: <a href=mailto:"[email protected]"> [email protected] </a>
Quoted 12 lines · Jan Kara
Quoted 11 lines · Gu Zheng
From
35947e6535d92c54cf523470cc8811e8b5fee3e5Mon Sep 17 00:00:00 2001
From: Gu Zheng <[email protected]>
Date: Tue, 23 Apr 2013 16:09:04 +0800
Subject: [PATCH]mm/filemap.c: fix criteria of callingiov_shorten()ingeneric_file_direct_write()
generic_file_direct_write()compares 'count'(the max count we actually can write) with 'ocount'(the count we request to write) to see if there is need to calliov_shorten()to reduce number of segments and the iovec's length. If the 'count' is equal or greater than 'ocount', there is no need to calliov_shorten()indeed. So the judgement should be changed:
'if (count != ocount)' --> 'if (count < ocount)'
Quoted 3 lines
Thanks for the patch but it shouldn't be really possible that count >
ocount, should it? So your patch doesn't really fix anything. Or am I missing something?
Hi Jan,
You are right, 'count' should not be greater than 'ocount' actually.
Please ignore this patch.
Thanks,
Gu
Quoted 24 lines
Honza
Quoted 22 lines
Signed-off-by Gu Zheng <[email protected]>--- mm/filemap.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)mm/filemap.c +1
-1@@ -2183,7 +2183,7 @@ generic_file_direct_write(struct kiocb *iocb, const struct iovec *iov,size_t write_len;pgoff_t end; -if (count != ocount) +if (count < ocount) *nr_segs =iov_shorten ((struct iovec *)iov, *nr_segs, count); write_len =iov_length (iov, *nr_segs);Signature · 1 line
1.7.7
Quoted 5 lines
Quoted 5 lines
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to [email protected]. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"[email protected]"> [email protected] </a>