NetBSD-Bugs archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: kern/43616 msdosfs rename dir dir/.. fails with EROFS instead of expected EINVAL



The following reply was made to PR kern/43616; it has been noted by GNATS.

From: Michael van Elst <mlelstv%serpens.de@localhost>
To: gnats-bugs%netbsd.org@localhost
Cc: 
Subject: Re: kern/43616 msdosfs rename dir dir/.. fails with EROFS instead
 of expected EINVAL
Date: Fri, 30 Jul 2010 09:51:37 +0200

 The wrong errno is returned for rename and delete operations
 to the root directory.
 
 # mount -t msdos /dev/vnd0d /mnt
 # cd /mnt
 # rmdir .
 rmdir: .: Read-only file system
 # mkdir a
 # cd a
 # rmdir .
 rmdir: .: Invalid argument
 
 
 This change should fix the problem.
 
 Index: msdosfs_lookup.c
 ===================================================================
 RCS file: /cvsroot/src/sys/fs/msdosfs/msdosfs_lookup.c,v
 retrieving revision 1.21
 diff -u -r1.21 msdosfs_lookup.c
 --- msdosfs_lookup.c   24 Jun 2010 13:03:09 -0000      1.21
 +++ msdosfs_lookup.c   30 Jul 2010 07:45:06 -0000
 @@ -461,7 +461,7 @@
                 * Don't allow deleting the root.
                 */
                if (blkoff == MSDOSFSROOT_OFS)
 -                      return EROFS;                   /* really? XXX */
 +                      return EINVAL;
  
                /*
                 * Write access to directory required to delete files.
 @@ -497,7 +497,7 @@
                        return (EROFS);
  
                if (blkoff == MSDOSFSROOT_OFS)
 -                      return EROFS;                           /* really? XXX 
*/
 +                      return EINVAL;
  
                error = VOP_ACCESS(vdp, VWRITE, cnp->cn_cred);
                if (error)
 
 
 -- 
                                 Michael van Elst
 Internet: mlelstv%serpens.de@localhost
                                 "A potential Snark may lurk in every tree."
 


Home | Main Index | Thread Index | Old Index