linux-dont-mark-writer-on-mmapped-RO-20040602
authorDerrick Brashear <shadow@dementia.org>
Wed, 2 Jun 2004 08:43:48 +0000 (08:43 +0000)
committerDerrick Brashear <shadow@dementia.org>
Wed, 2 Jun 2004 08:43:48 +0000 (08:43 +0000)
FIXES 4892

don't mark an mmapped RO as an execOrWriter.

src/afs/LINUX/osi_vnodeops.c

index ebefdc8..d10e3c3 100644 (file)
@@ -464,8 +464,9 @@ afs_linux_vma_close(struct vm_area_struct *vmap)
                (void)afs_close(vcp, vmap->vm_file->f_flags, credp);
                /* only decrement the execsOrWriters flag if this is not a
                 * writable file. */
-               if (!(vmap->vm_file->f_flags & (FWRITE | FTRUNC)))
-                   vcp->execsOrWriters--;
+               if (!(vcp->states & CRO) )
+                   if (! (vmap->vm_file->f_flags & (FWRITE | FTRUNC)))
+                       vcp->execsOrWriters--;
                vcp->states &= ~CMAPPED;
                crfree(credp);
            } else if ((vmap->vm_file->f_flags & (FWRITE | FTRUNC)))
@@ -546,7 +547,8 @@ afs_linux_mmap(struct file *fp, struct vm_area_struct *vmap)
 
        /* Add an open reference on the first mapping. */
        if (vcp->mapcnt == 0) {
-           vcp->execsOrWriters++;
+           if (!(vcp->states & CRO))
+               vcp->execsOrWriters++;
            vcp->opens++;
            vcp->states |= CMAPPED;
        }