[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20100820200401.1b824be5@notabene>
Date: Fri, 20 Aug 2010 20:04:01 +1000
From: Neil Brown <neilb@...e.de>
To: Christoph Hellwig <hch@...radead.org>
Cc: "Aneesh Kumar K.V" <aneesh.kumar@...ux.vnet.ibm.com>,
viro@...iv.linux.org.uk, adilger@....com, corbet@....net,
npiggin@...e.de, hooanon05@...oo.co.jp, bfields@...ldses.org,
miklos@...redi.hu, linux-fsdevel@...r.kernel.org,
sfrench@...ibm.com, philippe.deniel@....FR,
linux-kernel@...r.kernel.org
Subject: Re: [PATCH -V18 05/13] vfs: Support null pathname in readlink
On Fri, 20 Aug 2010 04:32:13 -0400
Christoph Hellwig <hch@...radead.org> wrote:
> Changing the interfaces of existing system calls to accept a NULL name
> which previously wasn't acceptable is not valid. Even for new system
> calls I think it's a bad idea. utimensat already has the most ugly
> code of all fs related system calls because of that.
Again, you have made an assertion without justifying it.
I disagree, I think it is perfectly valid.
The function would still return an error in every case that it previously
returned an error, because in every previous case the fd would not have
referred to a symlink so the new version will have nothing to perform a
readlink on when NULL is passed. The error would probably be EINVAL rather
than EFAULT but even that difference could be avoided if it was really
important (I doubt it is).
You only get different behaviour if the path name is NULL and the fd refers
to a symlink. This is a completely new situation for which there is no
precedent for how the syscall should behave. We are free to create whatever
behaviour is most consistent. I believe the proposed behaviour is the
correct one.
The code may be ugly, but I'm sure it can be tidied up, particularly if
several system-calls adopted the same calling convention.
NeilBrown
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists