Re: [PATCHSET] sysfs: use seq_file and unify regular and bin filehandling
From: Tejun Heo
Date: Tue Oct 01 2013 - 10:23:53 EST
Hello,
On Mon, Sep 30, 2013 at 11:03:50PM -0600, Bjorn Helgaas wrote:
> I don't pretend to understand sysfs or the issue you tripped over with
> PCI I/O BAR regions. But we had a long discussion about those files
The issue is rather simple. Let's say I do "dd if=SOME_IO_BAR skip=12
bs=4 count=1", it should result in exactly 4 byte read from the ioport
at BAR + 12 as io reads may have side effects; however, seq_file
breaks that with buffering. Pretty similar to using stdio on ioports.
> [1] last spring, and I'm pretty convinced that it was a mistake to add
> them in their current form, and I would support an attempt to rework
> them. We had some ideas about how to do that, but I think everybody
> lost interest before anything happened.
Yeah, I was pretty weirded out after finding out that the BARs are
directly accessible through sysfs. People run all sorts of scripts
over the sysfs hierarchy after all. That said, I don't think sysfs
can simply pull out bin file support at this point. I'll keep the
code path separate so that it can be easily separated out if we don't
need it later.
Thanks!
--
tejun
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/