1. Nov 22, 2009
    • Julia Lawall's avatar
      fs/ceph: Move a dereference below a NULL test · 32c895e7
      Julia Lawall authored
      If the NULL test is necessary, then the dereference should be moved below
      the NULL test.
      
      The semantic patch that makes this change is as follows:
      (http://coccinelle.lip6.fr/
      
      ).
      
      // <smpl>
      @@
      type T;
      expression E;
      identifier i,fld;
      statement S;
      @@
      
      - T i = E->fld;
      + T i;
        ... when != E
            when != i
        if (E == NULL) S
      + i = E->fld;
      // </smpl>
      
      Signed-off-by: default avatarJulia Lawall <julia@diku.dk>
      Signed-off-by: default avatarSage Weil <sage@newdream.net>
      32c895e7
    • Julia Lawall's avatar
      fs/ceph: introduce missing kfree · 60d87733
      Julia Lawall authored
      Error handling code following a kmalloc should free the allocated data.
      
      The semantic match that finds this problem is as follows:
      (http://www.emn.fr/x-info/coccinelle/
      
      )
      
      // <smpl>
      @r exists@
      local idexpression x;
      statement S;
      expression E;
      identifier f,f1,l;
      position p1,p2;
      expression *ptr != NULL;
      @@
      
      x@p1 = \(kmalloc\|kzalloc\|kcalloc\)(...);
      ...
      if (x == NULL) S
      <... when != x
           when != if (...) { <+...x...+> }
      (
      x->f1 = E
      |
       (x->f1 == NULL || ...)
      |
       f(...,x->f1,...)
      )
      ...>
      (
       return \(0\|<+...x...+>\|ptr\);
      |
       return@p2 ...;
      )
      
      @script:python@
      p1 << r.p1;
      p2 << r.p2;
      @@
      
      print "* file: %s kmalloc %s return %s" % (p1[0].file,p1[0].line,p2[0].line)
      // </smpl>
      
      Signed-off-by: default avatarJulia Lawall <julia@diku.dk>
      Signed-off-by: default avatarSage Weil <sage@newdream.net>
      60d87733
  2. Nov 21, 2009
  3. Nov 19, 2009
  4. Nov 13, 2009
  5. Nov 12, 2009
  6. Nov 11, 2009
  7. Nov 10, 2009
    • Sage Weil's avatar
      ceph: do not confuse stale and dead (unreconnected) caps · 685f9a5d
      Sage Weil authored
      
      
      We were using the cap_gen to track both stale caps (caps that timed out
      due to temporarily losing touch with the mds) and dead caps that did not
      reconnect after an MDS failure.  Introduce a recon_gen counter to track
      reconnections to restarted MDSs and kill dead caps based on that instead.
      
      Rename gen to cap_gen while we're at it to make it more clear which is
      which.
      
      Signed-off-by: default avatarSage Weil <sage@newdream.net>
      685f9a5d
  8. Nov 08, 2009
  9. Nov 07, 2009
  10. Nov 05, 2009
  11. Nov 04, 2009
  12. Nov 03, 2009
  13. Nov 02, 2009
  14. Oct 31, 2009
  15. Oct 29, 2009
  16. Oct 28, 2009