Thread (6 messages) 6 messages, 3 authors, 2007-09-14

Re: [PATCH] [-mm] FS: file name must be unique in the same dir in procfs

From: Andrew Morton <akpm@linux-foundation.org>
Date: 2007-09-10 07:50:01
Also in: linux-acpi, lkml

On Mon, 20 Aug 2007 23:50:05 +0800 Zhang Rui [off-list ref] wrote:
Hi, Oliver,
Thanks for your comments,

On Mon, 2007-08-20 at 18:45 +0800, Oliver Neukum wrote:
quoted
Am Montag 20 August 2007 schrieb Zhang Rui:
quoted
Files name must be unique in the same directory.

Bug is reported here:
http://bugzilla.kernel.org/show_bug.cgi?id=8798
Then I'd say fix the callers.
But at least the callers need to be told that something is wrong first.
quoted
 This will paper over bugs.
Hmm, what kind of bugs?
callers always need to check the return value when calling
proc_mkdir/create_proc_entry, don't they?
Yes, but there's some risk that such a change will cause a
presently-working system to stop working.  It's quite likely, if that
system is checking the procfs-creation return value.

So I think it'd be best if we were to detect the duplication and print a
warning (which should include, if possible, the full pathname and a
dump_stack()) and then the code should proceed as normal: permit the
duplicated entry and return success.

Then, when such duplicates are reported, we can work out what to do about
them on a case-by-case basis.

(btw, please feed your patches through scripts/checkpatch.pl - that one had
a remarkably high coding-style-error-density).
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help