On Mon, 17 Oct 2005 [EMAIL PROTECTED] wrote:

> Here is a patch which calls generic_permission() after nfs_permission()
> failed. Still it is not good solution, better than now a little bit.
> 
> 
> Junjiro Okajima
> 
> 
> --- unionfs-20051013-1721/inode.c     2005-10-14 06:21:24.000000000 +0900
> +++ inode.c   2005-10-16 19:08:39.000000000 +0900
> @@ -825,7 +825,7 @@
>  }
>  
>  /* Basically copied from the kernel vfs permission() -KK */
> -int inode_permission(struct inode *inode, int mask, struct nameidata *nd)
> +static int inode_permission(struct inode *inode, int mask, struct nameidata 
> *nd)
>  {
>       int retval, submask;
>  
> @@ -850,9 +850,21 @@
>  
>       /* Ordinary permission routines do not understand MAY_APPEND. */
>       submask = mask & ~MAY_APPEND;
> -     if (inode->i_op && inode->i_op->permission)
> +     retval = 1;
> +#define IS_NFS(inode) (strncmp("nfs", (inode)->i_sb->s_type->name, 4) == 0)
> +     if (inode->i_op && inode->i_op->permission) {
>               retval = inode->i_op->permission(inode, submask, nd);
> -     else
> +             /*
> +              * when the branch is not leftmost, we will copyup it later.
> +              * so we may ignore the error of 'nfs exported as readonly.'
> +              * This part depends on the filesystem, too bad.
> +              */
> +             ASSERT(retval <= 0);
> +             if (retval == -EACCES && (submask & MAY_WRITE)
> +                 && IS_NFS(inode))
> +                     retval = 1;
> +     }
> +     if (retval > 0)
>               retval = generic_permission(inode, submask, NULL);
>       if (retval)
>               return retval;


Just I saw that Junjiro's patch is not in the last snapshot 20051018-0013.
I am using it with 20051014-1448 without any problems.
So please insert it in the next snapshot.

Regards,
Martin 
_______________________________________________
unionfs mailing list
[email protected]
http://www.fsl.cs.sunysb.edu/mailman/listinfo/unionfs

Reply via email to