Re: [NFS] [PATCH] Make UDF exportable

!MAILaRCHIVE_VOTE_RePLACE
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
To: Rasmus Rohde <rohde@...>
Cc: <nfs@...>, <jack@...>, <linux-fsdevel@...>
Date: Tuesday, February 5, 2008 - 6:29 am

On Wed, Jan 30, 2008 at 09:53:24PM +0100, Rasmus Rohde wrote:

Thanks, I know some people have been waiting for this for quite a while.
Please make sure Jan Kara who's the new udf maintainer and linux-fsdevel
where we discuss general filesystem related issue for future revisions
of the patch.


isofs might not be the very best example since it's an odd filesystem,
but then so is udf.  I'll go through your patch in a little more detail
below, but it looks quite reasonable.


Any reason this is not called udf_get_parent to follow the scheme
in most filesystems?


This if/else block looks little odd, and following the locking is a bit
hard.  What about doing it like the following:

	lock_kernel();
	if (!udf_find_entry(child->d_inode, &dotdot, &fibh, &cfi))
		goto out_unlock;

	if (fibh.sbh != fibh.ebh)
		brelse(fibh.ebh);
	brelse(fibh.sbh);

	inode = udf_iget(child->d_inode->i_sb,
			 lelb_to_cpu(cfi.icb.extLocation));
	if (!inode)
		goto out_unlock;
	unlock_kernel();

	parent = d_alloc_anon(inode);
	if (!parent) {
		iput(inode);
		parent = ERR_PTR(-ENOMEM);
	}

	return parent;
 out_unlock:
	unlock_kernel();
	return ERR_PTR(-EACCESS);
}



to follow other filesystems this should be called
udf_nfs_get_inode.  Also please decide if you want to put the static
and return type on the same line or on a separate one.  Having it on
the same one is documented in Documentation/Codingstyle but separate
ones are acceptable aswell.  Just make sure to stick to either one :)


it would be better to introduce a version of udf_iget that can check
the generation and return an error instead of having to check this
later.  If you don't think you're up to modifying code we could do
this later on, though.  In this case please note this in the patch
description and fix up the above formatting to read something like:

	if (is_bad_inode(inode) ||
	    (generation && inode->i_generation != generation)) {


It would be useful if you could add symbolic constants for the
two fh types you add and chose values not yet used by other filesystems,
e.g. 0x51 and 0x52.  This will help people sniffing the nfs on the
wire protocol to understand what file handle they're dealing with.

Also you migh want to make the fh_len check more explicit and check
that it's either 3 or 5 which is the only fhs you actually generate.


and a check for len == 5 here.


and you can remove these checks as you only end up here with len == 5
fhs.

Also it would be nice if you could add your fid type to the union in
include/linux/exportfs.h and use the union member.  The symbolic names
for the FH types should go into enum fid_type with a short comment
describing them.

Thanks for all this work!
-
To unsubscribe from this list: send the line "unsubscribe linux-fsdevel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
Re: [NFS] [PATCH] Make UDF exportable, Christoph Hellwig, (Tue Feb 5, 6:29 am)
Re: [NFS] [PATCH] Make UDF exportable, Rasmus Rohde, (Tue Feb 5, 1:44 pm)
Re: [NFS] [PATCH] Make UDF exportable, Jan Kara, (Wed Feb 6, 2:08 pm)
Re: [NFS] [PATCH] Make UDF exportable, Rasmus Rohde, (Wed Feb 6, 4:58 pm)
Re: [NFS] [PATCH] Make UDF exportable, Christoph Hellwig, (Thu Feb 7, 1:45 am)
Re: [NFS] [PATCH] Make UDF exportable, Rasmus Rohde, (Thu Feb 7, 3:06 am)
Re: [NFS] [PATCH] Make UDF exportable, Jan Kara, (Thu Feb 7, 10:48 am)
Re: [NFS] [PATCH] Make UDF exportable, Rasmus Rohde, (Thu Feb 7, 11:02 am)
Re: [NFS] [PATCH] Make UDF exportable, Christoph Hellwig, (Tue Apr 29, 10:33 am)
Re: [NFS] [PATCH] Make UDF exportable, Jan Kara, (Wed Apr 30, 11:41 am)
Re: [NFS] [PATCH] Make UDF exportable, Jan Kara, (Thu Feb 7, 11:13 am)
Re: [NFS] [PATCH] Make UDF exportable, Christoph Hellwig, (Wed Feb 6, 11:37 pm)
Re: [NFS] [PATCH] Make UDF exportable, Rasmus Rohde, (Tue Feb 5, 3:26 pm)