Mail Archives: cygwin/2009/07/16/13:45:54
On Jul 16 17:15, Eric Blake wrote:
> Corinna Vinschen <corinna-cygwin <at> cygwin.com> writes:
> > Erm... it tries to use the recycle bin? Why? AFAICS, MVFS has the
> > FILE_REMOTE_DEVICE device characteristic set, so it's logically always a
> > remote drive and unlink_nt does not try to move the file to the recycle
> > bin if it's a remote drive. Can you please check again?
> >
>
> That was me speaking on assumptions rather than checking facts. I
> hadn't done any strace or procmon on the rm with open file handle, but
> when I did just that right now, I see you are correct that since the
> filesystem is remote, there was no attempt made to involve a recycle
> bin (just a SetDispositionInformationFile with argument Delete:true).
Ok, I'm glad to read that. Works as designed :)
> > I'm going to check in the changes to unlink_nt for now and add a MVFS
> > filesystem check. Then I'll always create winsymlinks when the target
> > filesystem is MVFS. That should deal with the original symlink problem
> > reported in the other thread. Of course, I need you to test this, if
> > you don't mind.
>
> I don't mind (my day job makes me use clearcase on a regular basis,
> but I do everything in cygwin by preference. So making cygwin work
> nicer with MVFS will make me more proficient at work). But testing
> cygwin patches can certainly be a bit awkward, given that the company
> firewall blocks ssh and CVS (and I can't test at home, given that I
Oh well. Ok, I planned to check this change in and let you then test
from CVS. But since that's a problem for you, here's the patch. The
important part is that Cygwin should now always create symlinks as
shortcuts on MVFS, regardless of the CYGWIN=winsymlink setting. Please
check.
Index: mount.h
===================================================================
RCS file: /cvs/src/src/winsup/cygwin/mount.h,v
retrieving revision 1.7
diff -u -p -r1.7 mount.h
--- mount.h 16 Jul 2009 09:56:25 -0000 1.7
+++ mount.h 16 Jul 2009 17:42:04 -0000
@@ -37,6 +37,7 @@ class fs_info
unsigned is_csc_cache : 1;
unsigned is_sunwnfs : 1;
unsigned is_unixfs : 1;
+ unsigned is_mvfs : 1;
};
unsigned long fs_flags;
};
@@ -65,6 +66,7 @@ class fs_info
IMPLEMENT_STATUS_FLAG (bool, is_csc_cache)
IMPLEMENT_STATUS_FLAG (bool, is_sunwnfs)
IMPLEMENT_STATUS_FLAG (bool, is_unixfs)
+ IMPLEMENT_STATUS_FLAG (bool, is_mvfs)
ULONG serial_number () const { return sernum; }
int has_buggy_open () const {return is_sunwnfs ();}
Index: mount.cc
===================================================================
RCS file: /cvs/src/src/winsup/cygwin/mount.cc,v
retrieving revision 1.42
diff -u -p -r1.42 mount.cc
--- mount.cc 16 Jul 2009 09:56:25 -0000 1.42
+++ mount.cc 16 Jul 2009 17:42:04 -0000
@@ -240,6 +240,10 @@ fs_info::update (PUNICODE_STRING upath,
&& FS_IS_NETAPP_DATAONTAP)
/* Microsoft NFS needs distinct access methods for metadata. */
&& !is_nfs (RtlEqualUnicodeString (&fsname, &ro_u_nfs, FALSE))
+ /* MVFS == Rational ClearCase remote filesystem. Has
+ a couple of drawbacks, like not supporting DOS attributes
+ other than R/O and stuff like that. */
+ && !is_mvfs (RtlEqualUnicodeString (&fsname, &ro_u_mvfs, FALSE))
/* Known remote file system which can't handle calls to
NtQueryDirectoryFile(FileIdBothDirectoryInformation) */
&& !is_unixfs (RtlEqualUnicodeString (&fsname, &ro_u_unixfs, FALSE)))
@@ -1386,22 +1390,28 @@ fillout_mntent (const char *native_path,
RtlAppendUnicodeToString (&unat, L"\\");
mntinfo.update (&unat, NULL);
- if (mntinfo.is_samba())
+ if (mntinfo.is_ntfs ())
+ strcpy (_my_tls.locals.mnt_type, (char *) "ntfs");
+ else if (mntinfo.is_fat ())
+ strcpy (_my_tls.locals.mnt_type, (char *) "vfat");
+ else if (mntinfo.is_samba())
strcpy (_my_tls.locals.mnt_type, (char *) "smbfs");
else if (mntinfo.is_nfs ())
strcpy (_my_tls.locals.mnt_type, (char *) "nfs");
- else if (mntinfo.is_fat ())
- strcpy (_my_tls.locals.mnt_type, (char *) "vfat");
- else if (mntinfo.is_ntfs ())
- strcpy (_my_tls.locals.mnt_type, (char *) "ntfs");
- else if (mntinfo.is_netapp ())
- strcpy (_my_tls.locals.mnt_type, (char *) "netapp");
else if (mntinfo.is_udf ())
strcpy (_my_tls.locals.mnt_type, (char *) "udf");
else if (mntinfo.is_cdrom ())
strcpy (_my_tls.locals.mnt_type, (char *) "iso9660");
+ else if (mntinfo.is_netapp ())
+ strcpy (_my_tls.locals.mnt_type, (char *) "netapp");
else if (mntinfo.is_csc_cache ())
strcpy (_my_tls.locals.mnt_type, (char *) "csc-cache");
+ else if (mntinfo.is_mvfs ())
+ strcpy (_my_tls.locals.mnt_type, (char *) "mvfs");
+ else if (mntinfo.is_unixfs ())
+ strcpy (_my_tls.locals.mnt_type, (char *) "unixfs");
+ else if (mntinfo.is_sunwnfs ())
+ strcpy (_my_tls.locals.mnt_type, (char *) "sunwnfs");
else
strcpy (_my_tls.locals.mnt_type, (char *) "unknown");
Index: path.h
===================================================================
RCS file: /cvs/src/src/winsup/cygwin/path.h,v
retrieving revision 1.127
diff -u -p -r1.127 path.h
--- path.h 25 Dec 2008 15:55:31 -0000 1.127
+++ path.h 16 Jul 2009 17:42:04 -0000
@@ -231,6 +231,7 @@ class path_conv
bool fs_is_nfs () const {return fs.is_nfs ();}
bool fs_is_netapp () const {return fs.is_netapp ();}
bool fs_is_cdrom () const {return fs.is_cdrom ();}
+ bool fs_is_mvfs () const {return fs.is_mvfs ();}
ULONG fs_serial_number () const {return fs.serial_number ();}
void set_path (const char *p) {strcpy (path, p);}
void fillin (HANDLE h);
Index: path.cc
===================================================================
RCS file: /cvs/src/src/winsup/cygwin/path.cc,v
retrieving revision 1.554
diff -u -p -r1.554 path.cc
--- path.cc 15 Jul 2009 13:27:34 -0000 1.554
+++ path.cc 16 Jul 2009 17:42:05 -0000
@@ -1367,6 +1367,7 @@ symlink_worker (const char *oldpath, con
HANDLE fh;
tmp_pathbuf tp;
unsigned check_opt;
+ bool mk_winsym = use_winsym;
/* POSIX says that empty 'newpath' is invalid input while empty
'oldpath' is valid -- it's symlink resolver job to verify if
@@ -1397,7 +1398,11 @@ symlink_worker (const char *oldpath, con
check_opt = PC_SYM_NOFOLLOW | PC_POSIX | (isdevice ? PC_NOWARN : 0);
/* We need the normalized full path below. */
win32_newpath.check (newpath, check_opt, stat_suffixes);
- if (use_winsym && !win32_newpath.exists ()
+ /* MVFS doesn't handle the SYSTEM DOS attribute, but it handles the R/O
+ attribute. Therefore we create symlinks on MVFS always as shortcuts. */
+ mk_winsym |= win32_newpath.fs_is_mvfs ();
+
+ if (mk_winsym && !win32_newpath.exists ()
&& (isdevice || !win32_newpath.fs_is_nfs ()))
{
char *newplnk = tp.c_get ();
@@ -1449,7 +1454,7 @@ symlink_worker (const char *oldpath, con
goto done;
}
- if (use_winsym)
+ if (mk_winsym)
{
ITEMIDLIST *pidl = NULL;
size_t full_len = 0;
@@ -1634,8 +1639,8 @@ symlink_worker (const char *oldpath, con
status = NtWriteFile (fh, NULL, NULL, NULL, &io, buf, cp - buf, NULL, NULL);
if (NT_SUCCESS (status) && io.Information == (ULONG) (cp - buf))
{
- status = NtSetAttributesFile (fh, use_winsym ? FILE_ATTRIBUTE_READONLY
- : FILE_ATTRIBUTE_SYSTEM);
+ status = NtSetAttributesFile (fh, mk_winsym ? FILE_ATTRIBUTE_READONLY
+ : FILE_ATTRIBUTE_SYSTEM);
if (!NT_SUCCESS (status))
debug_printf ("Setting attributes failed, status = %p", status);
res = 0;
@@ -1653,7 +1658,7 @@ symlink_worker (const char *oldpath, con
done:
syscall_printf ("%d = symlink_worker (%s, %s, %d, %d)", res, oldpath,
- newpath, use_winsym, isdevice);
+ newpath, mk_winsym, isdevice);
return res;
}
Thanks,
Corinna
--
Corinna Vinschen Please, send mails regarding Cygwin to
Cygwin Project Co-Leader cygwin AT cygwin DOT com
Red Hat
--
Problem reports: http://cygwin.com/problems.html
FAQ: http://cygwin.com/faq/
Documentation: http://cygwin.com/docs.html
Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple
- Raw text -