Prev: USB: serial: ftdi: correct merge conflict with CONTEC id
Next: DRM / radeon / KMS: Fix hibernation regression related to radeon PM (was: Re: [Regression, post-2.6.34] Hibernation broken on machines with radeon/KMS and r300)
From: Arnaldo Carvalho de Melo on 18 Jun 2010 10:50 Em Thu, Jun 17, 2010 at 11:11:35AM +0800, Gui Jianfeng escreveu: > Adam Schrotenboer wrote: > > On 06/15/2010 10:21 PM, Gui Jianfeng wrote: > >> Introduce a filter function to skip "." and ".." directories when calculating > >> tid number. > >> > >> +/* Skip "." and ".." directories */ > >> +static int filter(const struct dirent *dir) > >> +{ > >> + if (dir->d_name[0] == '.') > >> + return 0; > >> + else > >> + return 1; > > > > Is this safe? Can you _never_ have a d_name with a leading dot, like ' > > .hidden' ?? > > Admittedly I don't think it happens in the current procfs, but I'd want > > to be careful regardless. > > Actually, we only care the numeral directories. So, even if there's a ".hidden", > it's fine to filter out this directory. Just keep things simple here. Agreed, applying to perf/core, thanks, - Arnaldo -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo(a)vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/ |