* Re: [LTP] [PATCH] getdents01: don't compare first entry to "." [not found] <1365125797-31405-1-git-send-email-gaowanlong@cn.fujitsu.com> @ 2013-04-05 4:53 ` Mike Frysinger [not found] ` <1365142365-4089-1-git-send-email-gaowanlong@cn.fujitsu.com> 2013-04-05 9:08 ` [LTP] [PATCH] getdents01: don't compare first entry to "." chrubis 0 siblings, 2 replies; 4+ messages in thread From: Mike Frysinger @ 2013-04-05 4:53 UTC (permalink / raw) To: ltp-list [-- Attachment #1.1: Type: Text/Plain, Size: 1077 bytes --] On Thursday 04 April 2013 21:36:37 Wanlong Gao wrote: > --- a/testcases/kernel/syscalls/getdents/getdents01.c > +++ b/testcases/kernel/syscalls/getdents/getdents01.c > @@ -75,8 +75,6 @@ int main(int ac, char **av) > setup(); > > for (lc = 0; TEST_LOOPING(lc); lc++) { > - const char *d_name; > - > tst_count = 0; > > if ((fd = open(".", O_RDONLY)) == -1) > @@ -102,15 +100,7 @@ int main(int ac, char **av) > continue; > } > > - if (longsyscall) > - d_name = dirp64->d_name; > - else > - d_name = dirp->d_name; > - > - if (strcmp(d_name, ".")) > - tst_resm(TFAIL, "First entry is not '.'"); > - else > - tst_resm(TPASS, "call succeeded"); > + tst_resm(TPASS, "call succeeded"); > > if (close(fd) == -1) > tst_brkm(TBROK, cleanup, "file close failed"); this test isn't really useful after your change. you've basically validated that the a valid fd and a large enough buffer was passed to the kernel and that's it. you should have it walk the results to try and find an "." and ".." entry. -mike [-- Attachment #1.2: This is a digitally signed message part. --] [-- Type: application/pgp-signature, Size: 836 bytes --] [-- Attachment #2: Type: text/plain, Size: 351 bytes --] ------------------------------------------------------------------------------ Minimize network downtime and maximize team effectiveness. Reduce network management and security costs.Learn how to hire the most talented Cisco Certified professionals. Visit the Employer Resources Portal http://www.cisco.com/web/learning/employer_resources/index.html [-- Attachment #3: Type: text/plain, Size: 155 bytes --] _______________________________________________ Ltp-list mailing list Ltp-list@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/ltp-list ^ permalink raw reply [flat|nested] 4+ messages in thread
[parent not found: <1365142365-4089-1-git-send-email-gaowanlong@cn.fujitsu.com>]
* Re: [LTP] [PATCH V2] getdents01: compare "." or ".." to the first entry [not found] ` <1365142365-4089-1-git-send-email-gaowanlong@cn.fujitsu.com> @ 2013-04-05 9:00 ` chrubis 0 siblings, 0 replies; 4+ messages in thread From: chrubis @ 2013-04-05 9:00 UTC (permalink / raw) To: Wanlong Gao; +Cc: Garrett Cooper, LTP, Mike Frysinger Hi! > If dir_index feature is enabled on ext3/4, the first entry may > not be ".". So fix to compare "." or ".." to the first entry. > > Reported-by: DAN LI <li.dan@cn.fujitsu.com> > Signed-off-by: Wanlong Gao <gaowanlong@cn.fujitsu.com> Acked. -- Cyril Hrubis chrubis@suse.cz ------------------------------------------------------------------------------ Minimize network downtime and maximize team effectiveness. Reduce network management and security costs.Learn how to hire the most talented Cisco Certified professionals. Visit the Employer Resources Portal http://www.cisco.com/web/learning/employer_resources/index.html _______________________________________________ Ltp-list mailing list Ltp-list@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/ltp-list ^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [LTP] [PATCH] getdents01: don't compare first entry to "." 2013-04-05 4:53 ` [LTP] [PATCH] getdents01: don't compare first entry to "." Mike Frysinger [not found] ` <1365142365-4089-1-git-send-email-gaowanlong@cn.fujitsu.com> @ 2013-04-05 9:08 ` chrubis 2013-04-15 17:51 ` chrubis 1 sibling, 1 reply; 4+ messages in thread From: chrubis @ 2013-04-05 9:08 UTC (permalink / raw) To: Mike Frysinger; +Cc: ltp-list Hi! > > for (lc = 0; TEST_LOOPING(lc); lc++) { > > - const char *d_name; > > - > > tst_count = 0; > > > > if ((fd = open(".", O_RDONLY)) == -1) > > @@ -102,15 +100,7 @@ int main(int ac, char **av) > > continue; > > } > > > > - if (longsyscall) > > - d_name = dirp64->d_name; > > - else > > - d_name = dirp->d_name; > > - > > - if (strcmp(d_name, ".")) > > - tst_resm(TFAIL, "First entry is not '.'"); > > - else > > - tst_resm(TPASS, "call succeeded"); > > + tst_resm(TPASS, "call succeeded"); > > > > if (close(fd) == -1) > > tst_brkm(TBROK, cleanup, "file close failed"); > > this test isn't really useful after your change. you've basically validated > that the a valid fd and a large enough buffer was passed to the kernel and > that's it. > > you should have it walk the results to try and find an "." and ".." entry. Yes, that would be even better. Or we can get even more creative and create a file or two in the setup and expect them to be in the listing. -- Cyril Hrubis chrubis@suse.cz ------------------------------------------------------------------------------ Minimize network downtime and maximize team effectiveness. Reduce network management and security costs.Learn how to hire the most talented Cisco Certified professionals. Visit the Employer Resources Portal http://www.cisco.com/web/learning/employer_resources/index.html _______________________________________________ Ltp-list mailing list Ltp-list@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/ltp-list ^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [LTP] [PATCH] getdents01: don't compare first entry to "." 2013-04-05 9:08 ` [LTP] [PATCH] getdents01: don't compare first entry to "." chrubis @ 2013-04-15 17:51 ` chrubis 0 siblings, 0 replies; 4+ messages in thread From: chrubis @ 2013-04-15 17:51 UTC (permalink / raw) To: Mike Frysinger; +Cc: ltp-list Hi! > > this test isn't really useful after your change. you've basically validated > > that the a valid fd and a large enough buffer was passed to the kernel and > > that's it. > > > > you should have it walk the results to try and find an "." and ".." entry. > > Yes, that would be even better. Or we can get even more creative and > create a file or two in the setup and expect them to be in the listing. FYI: I've just commited a patch that creates file, directory and symlink and makes sure that these are included in the listing. -- Cyril Hrubis chrubis@suse.cz ------------------------------------------------------------------------------ Precog is a next-generation analytics platform capable of advanced analytics on semi-structured data. The platform includes APIs for building apps and a phenomenal toolset for data science. Developers can use our toolset for easy data analysis & visualization. Get a free account! http://www2.precog.com/precogplatform/slashdotnewsletter _______________________________________________ Ltp-list mailing list Ltp-list@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/ltp-list ^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2013-04-15 17:51 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
[not found] <1365125797-31405-1-git-send-email-gaowanlong@cn.fujitsu.com>
2013-04-05 4:53 ` [LTP] [PATCH] getdents01: don't compare first entry to "." Mike Frysinger
[not found] ` <1365142365-4089-1-git-send-email-gaowanlong@cn.fujitsu.com>
2013-04-05 9:00 ` [LTP] [PATCH V2] getdents01: compare "." or ".." to the first entry chrubis
2013-04-05 9:08 ` [LTP] [PATCH] getdents01: don't compare first entry to "." chrubis
2013-04-15 17:51 ` chrubis
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox