]> git.neil.brown.name Git - LaFS.git/commitdiff
Don't clear PinPending in blocks in the inode map.
authorNeilBrown <neilb@suse.de>
Mon, 28 Jun 2010 04:51:10 +0000 (14:51 +1000)
committerNeilBrown <neilb@suse.de>
Mon, 28 Jun 2010 04:51:10 +0000 (14:51 +1000)
We do not enforce exclusive access to these blocks, so it is not safe
to clear PinPending - some other thread might be allocating a nearby
inode and might need PinPending to remain.

It will get cleared at the next checkpoint or when the refcount on the
block hits zero, so there is no pressing need to clear it.

Signed-off-by: NeilBrown <neilb@suse.de>
README
inode.c

diff --git a/README b/README
index a5ae377a039bad253bf0e9c4e5f242dbcef6fc97..dd8986b6ca2f468a14b0581dbdeec724441814f6 100644 (file)
--- a/README
+++ b/README
@@ -4917,7 +4917,7 @@ DONE 13/ delete_inode should wait for pending truncate to complete.
 14/ Review writepage and flush and make sure we flush often enough but
     not too often.
 
-15/ The inode map file lost some credits.  I think it losts a PinPending because
+DONE 15/ The inode map file lost some credits.  I think it losts a PinPending because
     it isn't locked properly.  Don't clear PinPending if someone else might
     have set it.
 
diff --git a/inode.c b/inode.c
index 1ce736f5ee1aa5f8c6458f019014e1e68ad433a2..80f44c89a7959ee70f74a8a8aeee4ffc868e755e 100644 (file)
--- a/inode.c
+++ b/inode.c
@@ -1141,7 +1141,6 @@ retry:
                        LAFSI(im)->md.inodemap.size = bnum+1;
                        lafs_dirty_inode(im);
                        lafs_dirty_dblock(b);
-                       clear_bit(B_PinPending, &b->b.flags);
                        lafs_checkpoint_unlock(fs);
                        putdref(b, MKREF(cfi_map));
                }
@@ -1191,7 +1190,6 @@ retry:
 abort_unlock:
        lafs_checkpoint_unlock(fs);
 abort:
-       clear_bit(B_PinPending, &b->b.flags);
        putdref(b, MKREF(cfi_map));
        *bp = NULL;
        mutex_unlock(&im->i_mutex);
@@ -1264,7 +1262,6 @@ inode_map_new_commit(struct inode_map_new_info *imni)
        else
                lafs_dirty_dblock(imni->mb);
        clear_bit(B_PinPending, &imni->ib->b.flags);
-       clear_bit(B_PinPending, &imni->mb->b.flags);
        putdref(imni->ib, MKREF(cfi_ino));
        putdref(imni->mb, MKREF(cfi_map));
 }
@@ -1278,8 +1275,6 @@ inode_map_new_abort(struct inode_map_new_info *imni)
                lafs_orphan_release(fs_from_inode(imni->ib->b.inode),
                                    imni->ib);
        }
-       if (imni->mb)
-               clear_bit(B_PinPending, &imni->mb->b.flags);
        putdref(imni->ib, MKREF(cfi_ino));
        putdref(imni->mb, MKREF(cfi_map));
 }
@@ -1392,7 +1387,6 @@ retry:
        set_bit(bit, buf); // FIXME this is host-endian !!
        unmap_dblock(b, buf);
        lafs_dirty_dblock(b);
-       clear_bit(B_PinPending, &b->b.flags);
        putdref(b, MKREF(inode_map_free));
        lafs_checkpoint_unlock(fs);
        iput(im);