[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20070518111042.GC4869@in.ibm.com>
Date: Fri, 18 May 2007 16:40:42 +0530
From: Bharata B Rao <bharata@...ux.vnet.ibm.com>
To: Jan Engelhardt <jengelh@...ux01.gwdg.de>
Cc: linux-kernel@...r.kernel.org, linux-fsdevel@...r.kernel.org,
Jan Blunck <j.blunck@...harburg.de>
Subject: Re: [RFC][PATCH 10/14] In-kernel file copy between union mounted filesystems
On Wed, May 16, 2007 at 09:57:28AM +0200, Jan Engelhardt wrote:
>
> On May 14 2007 15:13, Bharata B Rao wrote:
> >+
> >+ if (flag & 0x2) {
> >+ error = union_copyup(nd, flag);
> >+ if (error)
> >+ goto exit;
> >+ }
>
> What I dislike (and that also goes for fs/namei.c and such) that they use
> numeral constants, i.e. 0x2. That seems error-prone. Could this (and
> the in-kernel users of 0x1/0x2/0x4) be turned into some constant?
>
> >+ if (IS_DEADDIR(parent->d_inode))
> >+ goto error;
> >+ err = -EACCES; /* shouldn't it be ENOSYS? */
>
> I do not think so. ENOSYS means Syscall not implemented. But it is
> implemented. If ->i_op is not there does not imply ENOSYS.
>
> Though, now that I grep through fs/*, I see that namei.c also
> has that comment "shouldn't it be ENOSYS", so it's all at odds.
>
> >+ if (!parent->d_inode->i_op || !parent->d_inode->i_op->create)
> >+ goto error;
>
> >+struct dentry * union_create_topmost(struct nameidata *nd, struct dentry *old)
> >+{
> >+ struct dentry *dentry;
> >+ struct dentry *parent = nd->dentry;
> >+
> >+ UM_DEBUG_UID("dentry=%s\n", old->d_name.name);
> >+
> >+ BUG_ON(parent->d_sb == old->d_sb);
> >+ if (!S_ISREG(old->d_inode->i_mode)) {
> >+ UM_DEBUG("This filetype isn't supported!\n");
>
> Does that mean I cannot create block devices, etc.?
>
Not really. This is called during copyup of a file residing in a lower
layer. And that is done only for regular files.
Regards,
Bharata.
-
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