> Date: Wed, 1 Jun 2016 10:04:12 +0200
> From: Martin Natano <[email protected]>
> 
> The following patch addresses an issue found by landry. mkdir on an ntfs
> mountpoint returns ENOENT, while the error should be EROFS. We don't
> support write access on ntfs.
> 
> Ok?

ok kettenis@

> Index: ntfs/ntfs_subr.c
> ===================================================================
> RCS file: /cvs/src/sys/ntfs/ntfs_subr.c,v
> retrieving revision 1.45
> diff -u -p -r1.45 ntfs_subr.c
> --- ntfs/ntfs_subr.c  7 Feb 2016 09:31:14 -0000       1.45
> +++ ntfs/ntfs_subr.c  31 May 2016 19:25:42 -0000
> @@ -1055,14 +1055,20 @@ ntfs_ntlookupfile(struct ntfsmount *ntmp
>               }
>       } while (1);
>  
> -     /* perform full scan if no entry was found */
> -     if (!fullscan && error == ENOENT) {
> -             fullscan = 1;
> -             cn = 0;         /* need zero, used by lookup_ctx */
> +     if (error == ENOENT) {
> +             /* perform full scan if no entry was found */
> +             if (!fullscan) {
> +                     fullscan = 1;
> +                     cn = 0;         /* need zero, used by lookup_ctx */
>  
> -             DDPRINTF("ntfs_ntlookupfile: fullscan performed for: %.*s\n",
> -                 (unsigned int)fnamelen, fname);
> -             goto loop;
> +                     DDPRINTF("ntfs_ntlookupfile: fullscan performed for: 
> %.*s\n",
> +                         (unsigned int)fnamelen, fname);
> +                     goto loop;
> +             }
> +
> +             if ((cnp->cn_flags & ISLASTCN) &&
> +                 (cnp->cn_nameiop == CREATE || cnp->cn_nameiop == RENAME))
> +                     error = EJUSTRETURN;
>       }
>  
>       DPRINTF("finish\n");
> 
> 

Reply via email to