Re: [issue1863] Implement 'hammer volume-list' subcommand

看板DFBSD_bugs作者時間15年前 (2010/11/20 02:01), 編輯推噓0(000)
留言0則, 0人參與, 最新討論串14/17 (看更多)
On 10/19/2010 10:59 PM, Stathis Kamperis (via DragonFly issue tracker) wrote: > > Stathis Kamperis <ekamperi@gmail.com> added the comment: > > New patch, same url: > http://stathisk.ath.cx/0001-HAMMER-Implement-volume-list-command.patch Can you explain why you use the 0001- prefix if you're going to use the same url over and over again? It's just extra pain for us to rename your patches, which is something I did, so now I can do the following, in order to only review your changes relative to the last patch. Comments inline. $ diff -u 000{1,2}-HAMMER-Implement-volume-list-command.patch -+ int i, cnt; ++ int i, cnt, len; + + for (i = 0, cnt = 0; i < HAMMER_MAX_VOLUMES && cnt < ioc->nvols; i++) { + volume = hammer_get_volume(hmp, i, &error); @@ -213,8 +213,13 @@ + } + KKASSERT(volume != NULL && error == 0); + ++ len = strlen(volume->vol_name) + 1; ++ if (len > MAXPATHLEN) { ++ len = MAXPATHLEN; ++ volume->vol_name[len - 1] = '\0'; ++ } + error = copyout(volume->vol_name, ioc->vols[cnt].device_name, -+ MAXPATHLEN); ++ len); Looks good, although you should probably just KKASSERT(len < MAXPATHLEN). Please commit. Aggelos
文章代碼(AID): #1CvhjkQe (DFBSD_bugs)
討論串 (同標題文章)
完整討論串 (本文為第 14 之 17 篇):
文章代碼(AID): #1CvhjkQe (DFBSD_bugs)