[lkml]   [2012]   [May]   [2]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
    SubjectRe: [PATCH] debugfs: New debugfs interface for creation of files, directory and symlinks
    On Wed, 2 May 2012 15:36:03 -0700
    Greg Kroah-Hartman <> wrote:

    > >
    > > The API is stupid and wrong, actually. There is no *advantage* to
    > > having done it this way - none at all.
    > Yes there is, it makes the caller logic trivial, which was the main goal
    > here in getting people to use it over creating new proc files all the
    > time for no good reason.
    > No one cares about the return value when you create a proc file, either
    > it succeeds or not, and you handle things from there, you never change
    > the name to try it again.
    > Same thing with debugfs, you only care if it works or not, and really,
    > you don't even care if it works, as the api lets you continue on if it
    > didn't just fine.
    > These are debugging files, with no set rules on what they contain. Yes,
    > people have grown to get used to them over the years, but the namespace
    > in which they work has worked out for itself, and I have yet to ever
    > hear of any two people wanting to create the same file/directory
    > anywhere, and have anything fail.
    > Or am I missing some subsystem that is having problems like this with
    > debugfs?

    grr, you appear to have ignored everything I wrote. Here it is again:

    > > That's the whole reason we have errnos: to report on what went wrong,
    > > so operators can understand *why* it failed and so that programmers can
    > > diagnose and fix bugs.


    > > If well-written code checks the return value (as it should) and then
    > > propagates an error code back to its caller (as it should), the stupid
    > > debugfs interface forces that caller to invent an errno from thin air.
    > > And if that guessed errno is wrong, it is actively misleading!

    I would add that an interface which encourages callers to silently
    ignore programming and configuration errors is not a good one.

     \ /
      Last update: 2012-05-03 01:21    [W:0.029 / U:5.236 seconds]
    ©2003-2016 Jasper Spaans. hosted at Digital OceanAdvertise on this site