* [PATCH] mm/filemap.c: fix criteria of calling iov_shorten() in generic_file_direct_write() @ 2013-04-23 8:37 Gu Zheng 2013-04-24 12:21 ` Jan Kara 0 siblings, 1 reply; 3+ messages in thread From: Gu Zheng @ 2013-04-23 8:37 UTC (permalink / raw) To: akpm; +Cc: linux-mm, linux-kernel, Al Viro, Jens ^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] mm/filemap.c: fix criteria of calling iov_shorten() in generic_file_direct_write() 2013-04-23 8:37 [PATCH] mm/filemap.c: fix criteria of calling iov_shorten() in generic_file_direct_write() Gu Zheng @ 2013-04-24 12:21 ` Jan Kara 2013-04-25 6:54 ` Gu Zheng 0 siblings, 1 reply; 3+ messages in thread From: Jan Kara @ 2013-04-24 12:21 UTC (permalink / raw) To: Gu Zheng; +Cc: akpm, linux-mm, linux-kernel, Al Viro, Jens On Tue 23-04-13 16:37:43, Gu Zheng wrote: > From 35947e6535d92c54cf523470cc8811e8b5fee3e5 Mon Sep 17 00:00:00 2001 > From: Gu Zheng <guz.fnst@cn.fujitsu.com> > Date: Tue, 23 Apr 2013 16:09:04 +0800 > Subject: [PATCH] mm/filemap.c: fix criteria of calling iov_shorten() in generic_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 call > iov_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 call iov_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 > > Signed-off-by: Gu Zheng <guz.fnst@cn.fujitsu.com> > --- > mm/filemap.c | 2 +- > 1 files changed, 1 insertions(+), 1 deletions(-) > > diff --git a/mm/filemap.c b/mm/filemap.c > index e1979fd..c566b9c 100644 > --- a/mm/filemap.c > +++ b/mm/filemap.c > @@ -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); > -- > 1.7.7 > > -- > To unsubscribe from this list: send the line "unsubscribe linux-kernel" in > the body of a message to majordomo@vger.kernel.org > More majordomo info at http://vger.kernel.org/majordomo-info.html > Please read the FAQ at http://www.tux.org/lkml/ -- Jan Kara <jack@suse.cz> SUSE Labs, CR -- To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to majordomo@kvack.org. For more info on Linux MM, see: http://www.linux-mm.org/ . Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a> ^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] mm/filemap.c: fix criteria of calling iov_shorten() in generic_file_direct_write() 2013-04-24 12:21 ` Jan Kara @ 2013-04-25 6:54 ` Gu Zheng 0 siblings, 0 replies; 3+ messages in thread From: Gu Zheng @ 2013-04-25 6:54 UTC (permalink / raw) To: Jan Kara; +Cc: akpm, linux-mm, linux-kernel, Al Viro, Jens On 04/24/2013 08:21 PM, Jan Kara wrote: > On Tue 23-04-13 16:37:43, Gu Zheng wrote: >> From 35947e6535d92c54cf523470cc8811e8b5fee3e5 Mon Sep 17 00:00:00 2001 >> From: Gu Zheng <guz.fnst@cn.fujitsu.com> >> Date: Tue, 23 Apr 2013 16:09:04 +0800 >> Subject: [PATCH] mm/filemap.c: fix criteria of calling iov_shorten() in generic_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 call >> iov_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 call iov_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? Hi Jan, You are right, 'count' should not be greater than 'ocount' actually. Please ignore this patch. Thanks, Gu > > Honza >> >> Signed-off-by: Gu Zheng <guz.fnst@cn.fujitsu.com> >> --- >> mm/filemap.c | 2 +- >> 1 files changed, 1 insertions(+), 1 deletions(-) >> >> diff --git a/mm/filemap.c b/mm/filemap.c >> index e1979fd..c566b9c 100644 >> --- a/mm/filemap.c >> +++ b/mm/filemap.c >> @@ -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); >> -- >> 1.7.7 >> >> -- >> To unsubscribe from this list: send the line "unsubscribe linux-kernel" in >> the body of a message to majordomo@vger.kernel.org >> 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 majordomo@kvack.org. For more info on Linux MM, see: http://www.linux-mm.org/ . Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a> ^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2013-04-25 6:56 UTC | newest] Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed) -- links below jump to the message on this page -- 2013-04-23 8:37 [PATCH] mm/filemap.c: fix criteria of calling iov_shorten() in generic_file_direct_write() Gu Zheng 2013-04-24 12:21 ` Jan Kara 2013-04-25 6:54 ` Gu Zheng
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox