On Mon, 13 Aug 2012 10:20:01 +0800 Shaohua Li <shli@xxxxxxxxxx> wrote: > >> >> 1:print cpulist of auxth, you maybe lost print the '\n'. > >> >> diff --git a/drivers/md/raid5.c b/drivers/md/raid5.c > >> >> index 7c8151a..3700cdc 100644 > >> >> --- a/drivers/md/raid5.c > >> >> +++ b/drivers/md/raid5.c > >> >> @@ -4911,9 +4911,13 @@ struct raid5_auxth_sysfs { > >> >> static ssize_t raid5_show_thread_cpulist(struct mddev *mddev, > >> >> struct raid5_auxth *thread, char *page) > >> >> { > >> >> + int n; > >> >> if (!mddev->private) > >> >> return 0; > >> >> - return cpulist_scnprintf(page, PAGE_SIZE, &thread->work_mask); > >> >> + n = cpulist_scnprintf(page, PAGE_SIZE - 2, &thread->work_mask); > >> >> + page[n++] = '\n'; > >> >> + page[n] = 0; > >> >> + return n; > >> >> } > >> >> > >> >> static ssize_t > >> > > >> >some sysfs entries print out '\n', some not, I don't mind add it > >> I search kernel code found places which like this print out '\n'; > >> Can you tell rule which use or not? > >> Thanks! > > > > I'm not aware any rule about this I can provide a rule if it helps: sysfs files must *always* end with '\n' unless they are empty. NeilBrown
Attachment:
signature.asc
Description: PGP signature