Hi Matthieu,

It looks like msdosfs_rename doesn't set the directory offset correctly
if a file is being renamed in the root directory. The following patch
fixes it for me:

Index: msdosfs_vnops.c
===================================================================
RCS file: /cvs/src/sys/msdosfs/msdosfs_vnops.c,v
retrieving revision 1.102
diff -u -p -u -r1.102 msdosfs_vnops.c
--- msdosfs_vnops.c     23 Oct 2015 10:45:31 -0000      1.102
+++ msdosfs_vnops.c     23 Oct 2015 16:07:38 -0000
@@ -1187,8 +1187,9 @@ abortit:
                                        VOP_UNLOCK(fdvp, 0, p);
                                goto bad;
                        }
+                       ip->de_diroffset = to_diroffset;
                        if (ip->de_dirclust != MSDOSFSROOT)
-                               ip->de_diroffset = to_diroffset & 
pmp->pm_crbomask;
+                               ip->de_diroffset &= pmp->pm_crbomask;
                }
                reinsert(ip);
                if (newparent)

Reply via email to