1. 09 Jul, 2007 40 commits
    • Bob Peterson's avatar
      [GFS2] remounting w/o acl option leaves acls enabled · 569a7b6c
      Bob Peterson authored
      This patch is for bugzilla bug #245663.  This crosswrites a fix from
      gfs1 (bz #210369) so that the mount options are reset properly upon
      remount.  This was tested on system trin-10.
      Signed-off-by: default avatarBob Peterson <rpeterso@redhat.com>
      Signed-off-by: default avatarSteven Whitehouse <swhiteho@redhat.com>
      569a7b6c
    • Wendy Cheng's avatar
      [GFS2] inode size inconsistency · 090ffaa5
      Wendy Cheng authored
      This should have been part of the NFS patch #1 but somehow I missed it
      when packaging the patches. It is not a critical issue as the others (I
      hope). RHEL 5.1 31.el5 kernel runs fine without this change.
      
      Our truncate code is chopped into two parts, one for vfs inode changes
      (in vmtruncate()) and one of gfs inode (in gfs2_truncatei()). These two
      operatons are, unfortunately, not atomic. So it could happens that
      vmtruncate() succeeds (inode->i_size is changed) but gfs2_truncatei
      fails (say kernel temporarily out of memory). This would leave gfs inode
      i_di.di_size out of sync with vfs inode i_size. It will later confuse
      gfs2_commit_write() if a write is issued. Last time I checked, it will
      cause file corruption.
      Signed-off-by: default avatarS. Wendy Cheng <wcheng@redhat.com>
      Signed-off-by: default avatarSteven Whitehouse <swhiteho@redhat.com>
      090ffaa5
    • Patrick Caulfield's avatar
      [DLM] Telnet to port 21064 can stop all lockspaces · 97d84836
      Patrick Caulfield authored
      This patch fixes Red Hat bz#245892
      
      Opening a tcp connection from a cluster member to another cluster member
      targeting the dlm port it is enough to stop every dlm operation in the cluster.
      This means that GFS and rgmanager will hang.
      Signed-Off-By: default avatarPatrick Caulfield <pcaulfie@redhat.com>
      Signed-off-by: default avatarSteven Whitehouse <swhiteho@redhat.com>
      97d84836
    • S. Wendy Cheng's avatar
      [GFS2] Fix gfs2_block_truncate_page err return · 1875f2f3
      S. Wendy Cheng authored
      Code segment inside gfs2_block_truncate_page() doesn't set the return
      code correctly. This causes NFSD erroneously returns EIO back to client
      with setattr procedure call (truncate error).
      Signed-off-by: default avatarS. Wendy Cheng <wcheng@redhat.com>
      Signed-off-by: default avatarSteven Whitehouse <swhiteho@redhat.com>
      1875f2f3
    • Robert Peterson's avatar
      [GFS2] Addendum to the journaled file/unmount patch · 773ed1a0
      Robert Peterson authored
      This patch is an addendum to the previous journaled file/unmount patch.
      It fixes a problem discovered during testing.
      Signed-off-by: default avatarBob Peterson <rpeterso@redhat.com>
      Signed-off-by: default avatarSteven Whitehouse <swhiteho@redhat.com>
      773ed1a0
    • Steven Whitehouse's avatar
      [GFS2] Simplify multiple glock aquisition · eaf5bd3c
      Steven Whitehouse authored
      There is a bug in the code which acquires multiple glocks where if the
      initial out-of-order attempt fails part way though we can land up trying
      to acquire the wrong number of glocks. This is part of the fix for red
      hat bz #239737. The other part of the bz doesn't apply to upstream
      kernels since it was fixed by:
      
      http://git.kernel.org/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commitdiff;h=d3717bdf8f08a0e1039158c8bab2c24d20f492b6
      
      Since the out-of-order code doesn't appear to add anything to the
      performance of GFS2, this patch just removed it rather than trying to
      fix it. It should be much easier to see whats going on here now. In
      addition, we don't allocate any memory unless we are using a lot of
      glocks (which is a relatively uncommon case).
      Signed-off-by: default avatarSteven Whitehouse <swhiteho@redhat.com>
      eaf5bd3c
    • Robert Peterson's avatar
      [GFS2] assertion failure after writing to journaled file, umount · 2332c443
      Robert Peterson authored
      This patch passes all my nasty tests that were causing the code to
      fail under one circumstance or another.  Here is a complete summary
      of all changes from today's git tree, in order of appearance:
      
      1. There are now separate variables for metadata buffer accounting.
      2. Variable sd_log_num_hdrs is no longer needed, since the header
         accounting is taken care of by the reserve/refund sequence.
      3. Fixed a tiny grammatical problem in a comment.
      4. Added a new function "calc_reserved" to calculate the reserved
         log space.  This isn't entirely necessary, but it has two benefits:
         First, it simplifies the gfs2_log_refund function greatly.
         Second, it allows for easier debugging because I could sprinkle the
         code with calls to this function to make sure the accounting is
         proper (by adding asserts and printks) at strategic point of the code.
      5. In log_pull_tail there apparently was a kludge to fix up the
         accounting based on a "pull" parameter.  The buffer accounting is
         now done properly, so the kludge was removed.
      6. File sync operations were making a call to gfs2_log_flush that
         writes another journal header.  Since that header was unplanned
         for (reserved) by the reserve/refund sequence, the free space had
         to be decremented so that when log_pull_tail gets called, the free
         space is be adjusted properly.  (Did I hear you call that a kludge?
         well, maybe, but a lot more justifiable than the one I removed).
      7. In the gfs2_log_shutdown code, it optionally syncs the log by
         specifying the PULL parameter to log_write_header.  I'm not sure
         this is necessary anymore.  It just seems to me there could be
         cases where shutdown is called while there are outstanding log
         buffers.
      8. In the (data)buf_lo_before_commit functions, I changed some offset
         values from being calculated on the fly to being constants.	That
         simplified some code and we might as well let the compiler do the
         calculation once rather than redoing those cycles at run time.
      9. This version has my rewritten databuf_lo_add function.
         This version is much more like its predecessor, buf_lo_add, which
         makes it easier to understand.  Again, this might not be necessary,
         but it seems as if this one works as well as the previous one,
         maybe even better, so I decided to leave it in.
      10. In databuf_lo_before_commit, a previous data corruption problem
         was caused by going off the end of the buffer.  The proper solution
         is to have the proper limit in place, rather than stopping earlier.
         (Thus my previous attempt to fix it is wrong).
         If you don't wrap the buffer, you're stopping too early and that
         causes more log buffer accounting problems.
      11. In lops.h there are two new (previously mentioned) constants for
         figuring out the data offset for the journal buffers.
      12. There are also two new functions, buf_limit and databuf_limit to
         calculate how many entries will fit in the buffer.
      13. In function gfs2_meta_wipe, it needs to distinguish between pinned
         metadata buffers and journaled data buffers for proper journal buffer
         accounting.	It can't use the JDATA gfs2_inode flag because it's
         sometimes passed the "real" inode and sometimes the "metadata
         inode" and the inode flags will be random bits in a metadata
         gfs2_inode.	It needs to base its decision on which was passed in.
      Signed-off-by: default avatarBob Peterson <rpeterso@redhat.com>
      Signed-off-by: default avatarSteven Whitehouse <swhiteho@redhat.com>
      2332c443
    • Steven Whitehouse's avatar
      [GFS2] Use zero_user_page() in stuffed_readpage() · 2840501a
      Steven Whitehouse authored
      As suggested by Robert P. J. Day <rpjday@mindspring.com>
      Signed-off-by: default avatarSteven Whitehouse <swhiteho@redhat.com>
      Cc: Robert P. J. Day <rpjday@mindspring.com>
      2840501a
    • Steven Whitehouse's avatar
      [GFS2] Remove bogus '\0' in rgrp.c · c4201214
      Steven Whitehouse authored
      Not sure how it slipped in, but we don't want it anyway.
      Signed-off-by: default avatarSteven Whitehouse <swhiteho@redhat.com>
      c4201214
    • Robert Peterson's avatar
      [GFS2] Journaled file write/unstuff bug · 8fb68595
      Robert Peterson authored
      This patch is for bugzilla bug 283162, which uncovered a number of
      bugs pertaining to writing to files that have the journaled bit on.
      These bugs happen most often when writing to the meta_fs because
      the files are always journaled.  So operations like gfs2_grow were
      particularly vulnerable, although many of the problems could be
      recreated with normal files after setting the journaled bit on.
      The problems fixed are:
      
      -GFS2 wasn't ever writing unstuffed journaled data blocks to their
       in-place location on disk. Now it does.
      
      -If you unmounted too quickly after doing IO to a journaled file,
       GFS2 was crashing because you would discard a buffer whose bufdata
       was still on the active items list.  GFS2 now deals with this
       gracefully.
      
      -GFS2 was losing track of the bufdata for journaled data blocks,
       and it wasn't getting freed, causing an error when you tried to
       unmount the module.  GFS2 now frees all the bufdata structures.
      
      -There was a memory corruption occurring because GFS2 wrote
       twice as many log entries for journaled buffers.
      
      -It was occasionally trying to write journal headers in buffers
       that weren't currently mapped.
      Signed-off-by: default avatarBob Peterson <rpeterso@redhat.com>
      Signed-off-by: default avatarBenjamin Marzinski <bmarzins@redhat.com>
      Signed-off-by: default avatarSteven Whitehouse <swhiteho@redhat.com>
      8fb68595
    • David Teigland's avatar
      [DLM] don't require FS flag on all nodes · fad59c13
      David Teigland authored
      Mask off the recently added DLM_LSFL_FS flag when setting the exflags.
      This way all the nodes in the lockspace aren't required to have the FS
      flag set, since we later check that exflags matches among all nodes.
      Signed-off-by: default avatarPatrick Caulfield <pcaulfie@redhat.com>
      Signed-off-by: default avatarDavid Teigland <teigland@redhat.com>
      Signed-off-by: default avatarSteven Whitehouse <swhiteho@redhat.com>
      fad59c13
    • Abhijith Das's avatar
      [GFS2] Fix deallocation issues · d93cfa98
      Abhijith Das authored
      There were two issues during deallocation of unlinked inodes. The
      first was relating to the use of a "try" lock which in the case of
      the inode lock wasn't trying hard enough to deallocate in all
      circumstances (now changed to a normal glock) and in the case of
      the iopen lock didn't wait for the demotion of the shared lock before
      attempting to get the exclusive lock, and thereby sometimes (timing dependent)
      not completing the deallocation when it should have done.
      
      The second issue related to the lack of a way to invalidate dcache entries
      on remote nodes (now fixed by this patch) which meant that unlinks were
      taking a long time to return disk space to the fs. By adding some code to
      invalidate the dcache entries across the cluster for unlinked inodes, that
      is now fixed.
      
      This patch was written jointly by Abhijith Das and Steven Whitehouse.
      Signed-off-by: default avatarAbhijith Das <adas@redhat.com>
      Signed-off-by: default avatarSteven Whitehouse <swhiteho@redhat.com>
      d93cfa98
    • David Teigland's avatar
      [GFS2] return conflicts for GETLK · a7a2ff8a
      David Teigland authored
      We weren't returning the correct result when GETLK found a conflict,
      which is indicated by userspace passing back a 1.
      
      Signed-off-by: Abhijith Das <adas redhat com>
      Signed-off-by: David Teigland <teigland redhat com>
      Signed-off-by: default avatarSteven Whitehouse <swhiteho@redhat.com>
      a7a2ff8a
    • David Teigland's avatar
      [GFS2] set plock owner in GETLK info · d88101d4
      David Teigland authored
      Set the owner field in the plock info sent to userspace for GETLK.
      Without this, gfs_controld won't correctly see when the GETLK from a
      process matches one of the process's existing locks.
      Signed-off-by: default avatarDavid Teigland <teigland@redhat.com>
      Signed-off-by: default avatarSteven Whitehouse <swhiteho@redhat.com>
      d88101d4
    • akpm@linux-foundation.org's avatar
      [GFS2] gfs2_lookupi() uninitialised var fix · 037bcbb7
      akpm@linux-foundation.org authored
      fs/gfs2/inode.c: In function 'gfs2_lookupi':
      fs/gfs2/inode.c:392: warning: 'error' may be used uninitialized in this function
      
      Looks like a real bug to me.
      
      Cc: Steven Whitehouse <swhiteho@redhat.com>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: default avatarSteven Whitehouse <swhiteho@redhat.com>
      037bcbb7
    • Steven Whitehouse's avatar
      [GFS2] Recovery for lost unlinked inodes · c8cdf479
      Steven Whitehouse authored
      Under certain circumstances its possible (though rather unlikely) that
      inodes which were unlinked by one node while still open on another might
      get "lost" in the sense that they don't get deallocated if the node
      which held the inode open crashed before it was unlinked.
      
      This patch adds the recovery code which allows automatic deallocation of
      the inode if its found during block allocation (the sensible time to
      look for such inodes since we are scanning the rgrp's bitmaps anyway at
      this time, so it adds no overhead to do this).
      
      Since the inode will have had its i_nlink set to zero, all we need to
      trigger recovery is a lookup and an iput(), and the normal deallocation
      code takes care of the rest.
      Signed-off-by: default avatarSteven Whitehouse <swhiteho@redhat.com>
      c8cdf479
    • Robert Peterson's avatar
      [GFS2] Can't mount GFS2 file system on AoE device · b35997d4
      Robert Peterson authored
      This patch fixes bug 243131: Can't mount GFS2 file system on AoE device.
      When using AoE devices with lock_nolock, there is no locking table, so
      gfs2 (and gfs1) uses the superblock s_id.  This turns out to be the device
      name in some cases.  In the case of AoE, the device contains a slash,
      (e.g. "etherd/e1.1p2") which is an invalid character when we try to
      register the table in sysfs.  This patch replaces the "/" with underscore.
      Rather than add a new variable to the stack, I'm just reusing a (char *)
      variable that's no longer used: table.
      
      This code has been tested on the failing system using a RHEL5 patch.
      The upstream code was tested by using gfs2_tool sb to interject a "/"
      into the table name of a clustered gfs2 file system.
      Signed-off-by: default avatarBob Peterson <rpeterso@redhat.com>
      Signed-off-by: default avatarSteven Whitehouse <swhiteho@redhat.com>
      b35997d4
    • Steven Whitehouse's avatar
      [GFS2] Fix bug in error path of inode · e1cc8603
      Steven Whitehouse authored
      This fixes a bug in the ordering of operations in the error path of
      createi. Its not valid to do an iput() when holding the inode's glock
      since the iput() will (in this case) result in delete_inode() being
      called which needs to grab the lock itself. This was causing the
      recursive lock checking code to trigger.
      Signed-off-by: default avatarSteven Whitehouse <swhiteho@redhat.com>
      e1cc8603
    • Steven Whitehouse's avatar
      [GFS2] Fix typo in rename of directories · ffed8ab3
      Steven Whitehouse authored
      A typo caused us to pass a NULL pointer when renaming directories. It
      was accidentally introduced in: [GFS2] Clean up inode number handling
      Signed-off-by: default avatarSteven Whitehouse <swhiteho@redhat.com>
      ffed8ab3
    • Patrick Caulfield's avatar
      [DLM] variable allocation · 44f487a5
      Patrick Caulfield authored
      Add a new flag, DLM_LSFL_FS, to be used when a file system creates a lockspace.
      This flag causes the dlm to use GFP_NOFS for allocations instead of GFP_KERNEL.
      (This updated version of the patch uses gfp_t for ls_allocation.)
      Signed-Off-By: default avatarPatrick Caulfield <pcaulfie@redhat.com>
      Signed-Off-By: default avatarDavid Teigland <teigland@redhat.com>
      Signed-off-by: default avatarSteven Whitehouse <swhiteho@redhat.com>
      44f487a5
    • Josef Bacik's avatar
      [DLM] fix reference counting · 292e539e
      Josef Bacik authored
      This is a fix for the patch
      
      021d2ff3a08019260a1dc002793c92d6bf18afb6
      
      I left off a dlm_hold_rsb which causes the box to panic if you try to use
      debugfs.  This patch fixes the problem.  Sorry about that,
      Signed-off-by: default avatarJosef Bacik <jwhiter@redhat.com>
      Signed-off-by: default avatarSteven Whitehouse <swhiteho@redhat.com>
      292e539e
    • Steven Whitehouse's avatar
      [GFS2] Add nanosecond timestamp feature · 4bd91ba1
      Steven Whitehouse authored
      This adds a nanosecond timestamp feature to the GFS2 filesystem. Due
      to the way that the on-disk format works, older filesystems will just
      appear to have this field set to zero. When mounted by an older version
      of GFS2, the filesystem will simply ignore the extra fields so that
      it will again appear to have whole second resolution, so that its
      trivially backward compatible.
      Signed-off-by: default avatarSteven Whitehouse <swhiteho@redhat.com>
      4bd91ba1
    • Steven Whitehouse's avatar
      [GFS2] Fix sign problem in quota/statfs and cleanup _host structures · bb8d8a6f
      Steven Whitehouse authored
      This patch fixes some sign issues which were accidentally introduced
      into the quota & statfs code during the endianess annotation process.
      Also included is a general clean up which moves all of the _host
      structures out of gfs2_ondisk.h (where they should not have been to
      start with) and into the places where they are actually used (often only
      one place). Also those _host structures which are not required any more
      are removed entirely (which is the eventual plan for all of them).
      
      The conversion routines from ondisk.c are also moved into the places
      where they are actually used, which for almost every one, was just one
      single place, so all those are now static functions. This also cleans up
      the end of gfs2_ondisk.h which no longer needs the #ifdef __KERNEL__.
      
      The net result is a reduction of about 100 lines of code, many functions
      now marked static plus the bug fixes as mentioned above. For good
      measure I ran the code through sparse after making these changes to
      check that there are no warnings generated.
      
      This fixes Red Hat bz #239686
      Signed-off-by: default avatarSteven Whitehouse <swhiteho@redhat.com>
      bb8d8a6f
    • Benjamin Marzinski's avatar
      [GFS2] fix jdata issues · ddf4b426
      Benjamin Marzinski authored
      This is a patch for the first three issues of RHBZ #238162
      
      The first issue is that when you allocate a new page for a file, it will not
      start off uptodate. This makes sense, since you haven't written anything to that
      part of the file yet.  Unfortunately, gfs2_pin() checks to make sure that the
      buffers are uptodate.  The solution to this is to mark the buffers uptodate in
      gfs2_commit_write(), after they have been zeroed out and have the data written
      into them.  I'm pretty confident with this fix, although it's not completely
      obvious that there is no problem with marking the buffers uptodate here.
      
      The second issue is simply that you can try to pin a data buffer that is already
      on the incore log, and thus, already pinned. This patch checks to see if this
      buffer is already on the log, and exits databuf_lo_add() if it is, just like
      buf_lo_add() does.
      
      The third issue is that gfs2_log_flush() doesn't do it's block accounting
      correctly.  Both metadata and journaled data are logged, but gfs2_log_flush()
      only compares the number of metadata blocks with the number of blocks to commit
      to the ondisk journal.  This patch also counts the journaled data blocks.
      Signed-off-by: default avatarBenjamin Marzinski <bmarzins@redhat.com>
      Signed-off-by: default avatarSteven Whitehouse <swhiteho@redhat.com>
      ddf4b426
    • Patrick Caulfield's avatar
      [DLM] fix socket shutdown · afb853fb
      Patrick Caulfield authored
      This patch clears the user_data of active sockets as part of cleanup.
      This prevents any late-arriving data from trying to add jobs to the work
      queue while we are tidying up.
      Signed-Off-By: default avatarPatrick Caulfield <pcaulfie@redhat.com>
      Signed-Off-By: default avatarDavid Teigland <teigland@redhat.com>
      Signed-off-by: default avatarSteven Whitehouse <swhiteho@redhat.com>
      afb853fb
    • Steven Whitehouse's avatar
      [GFS2] Make the log reserved blocks depend on block size · 89918647
      Steven Whitehouse authored
      The number of blocks which we reserve in the log at the start of each
      transaction needs to depends upon the block size since the overhead is
      related to the number of "pointers" which can be fitted into a single
      block.
      
      This relates to Red Hat bz #240435
      Signed-off-by: default avatarSteven Whitehouse <swhiteho@redhat.com>
      89918647
    • Abhijith Das's avatar
      [GFS2] Quotas non-functional - fix another bug · 1990e917
      Abhijith Das authored
      This patch fixes a bug where gfs2 was writing update quota usage
      information to the wrong location in the quota file.
      Signed-off-by: default avatarAbhijith Das <adas@redhat.com>
      Signed-off-by: default avatarSteven Whitehouse <swhiteho@redhat.com>
      1990e917
    • David Teigland's avatar
      [DLM] show default protocol · 0b7cac0f
      David Teigland authored
      Display the initial value of the "protocol" config value in configfs.
      The default value has always been 0 in the past anyway, so it's always
      appeared to be correct.
      Signed-off-by: default avatarDavid Teigland <teigland@redhat.com>
      Signed-off-by: default avatarSteven Whitehouse <swhiteho@redhat.com>
      0b7cac0f
    • David Teigland's avatar
      [DLM] dumping master locks · 9dd592d7
      David Teigland authored
      Add a new debugfs file that dumps a compact list of mastered locks.
      This will be used by a userland daemon to collect state for deadlock
      detection.
      
      Also, for the existing function that prints all lock state, lock the rsb
      before going through the lock lists since they can be changing in the
      course of normal dlm activity.
      Signed-off-by: default avatarDavid Teigland <teigland@redhat.com>
      Signed-off-by: default avatarSteven Whitehouse <swhiteho@redhat.com>
      9dd592d7
    • David Teigland's avatar
      [DLM] canceling deadlocked lock · 8b4021fa
      David Teigland authored
      Add a function that can be used through libdlm by a system daemon to cancel
      another process's deadlocked lock.  A completion ast with EDEADLK is returned
      to the process waiting for the lock.
      Signed-off-by: default avatarDavid Teigland <teigland@redhat.com>
      Signed-off-by: default avatarSteven Whitehouse <swhiteho@redhat.com>
      8b4021fa
    • David Teigland's avatar
      [DLM] timeout fixes · 84d8cd69
      David Teigland authored
      Various fixes related to the new timeout feature:
      - add_timeout() missed setting TIMEWARN flag on lkb's when the
        TIMEOUT flag was already set
      - clear_proc_locks should remove a dead process's locks from the
        timeout list
      - the end-of-life calculation for user locks needs to consider that
        ETIMEDOUT is equivalent to -DLM_ECANCEL
      - make initial default timewarn_cs config value visible in configfs
      - change bit position of TIMEOUT_CANCEL flag so it's not copied to
        a remote master node
      - set timestamp on remote lkb's so a lock dump will display the time
        they've been waiting
      Signed-off-by: default avatarDavid Teigland <teigland@redhat.com>
      Signed-off-by: default avatarSteven Whitehouse <swhiteho@redhat.com>
      84d8cd69
    • Steven Whitehouse's avatar
      [DLM] Compile fix · b3cab7b9
      Steven Whitehouse authored
      A one liner fix which got missed from the earlier patches.
      Signed-off-by: default avatarSteven Whitehouse <swhiteho@redhat.com>
      Cc: Fabio Massimo Di Nitto <fabbione@ubuntu.com>
      Cc: David Teigland <teigland@redhat.com>
      b3cab7b9
    • Fabio Massimo Di Nitto's avatar
      [GFS2] latest gfs2-nmw headers break userland build · 518bbde3
      Fabio Massimo Di Nitto authored
      2e8701a15cd6f7c95e74d6660615a69b09e453ef commit breaks libgfs2 build:
      
      gcc -Wall -I/usr/src/ubuntu/mypkgs/rhcluster/cluster/config -DHELPER_PROGRAM
      -D_FILE_OFFSET_BITS=64 -DGFS2_RELEASE_NAME=\"2.0\" -ggdb  -I/usr/include
      -I../include -I../libgfs2 -c -o gfs2hex.o gfs2hex.c
      In file included from hexedit.h:22,
                        from gfs2hex.c:27:
      /usr/include/linux/gfs2_ondisk.h:505: error: expected specifier-qualifier-list
      before ‘u32’
      make[2]: *** [gfs2hex.o] Error 1
      make[2]: Leaving directory `/usr/src/ubuntu/mypkgs/rhcluster/cluster/gfs2/edit'
      make[1]: *** [all] Error 2
      make[1]: Leaving directory `/usr/src/ubuntu/mypkgs/rhcluster/cluster/gfs2'
      make: *** [gfs2] Error 2
      Signed-off-by: default avatarFabio Massimo Di Nitto <fabbione@ubuntu.com>
      Signed-off-by: default avatarSteven Whitehouse <swhiteho@redhat.com>
      518bbde3
    • David Teigland's avatar
      [DLM] fix compile breakage · 639aca41
      David Teigland authored
      In the rush to get the previous patch set sent, a compilation bug I fixed
      shortly before sending somehow got clobbered, probably by a missed quilt
      refresh or something.
      Signed-off-by: default avatarDavid Teigland <teigland@redhat.com>
      Signed-off-by: default avatarSteven Whitehouse <swhiteho@redhat.com>
      639aca41
    • David Teigland's avatar
      [DLM] wait for config check during join [6/6] · 8b0e7b2c
      David Teigland authored
      Joining the lockspace should wait for the initial round of inter-node
      config checks to complete before returning.  This way, if there's a
      configuration mismatch between the joining node and the existing nodes,
      the join can fail and return an error to the application.
      Signed-off-by: default avatarDavid Teigland <teigland@redhat.com>
      Signed-off-by: default avatarSteven Whitehouse <swhiteho@redhat.com>
      8b0e7b2c
    • David Teigland's avatar
      [DLM] fix new_lockspace error exit [5/6] · 79d72b54
      David Teigland authored
      Fix the error path when exiting new_lockspace().  It was kfree'ing the
      lockspace struct at the end, but that's only valid if it exits before
      kobject_register occured.  After kobject_register we have to let the
      kobject do the freeing.
      Signed-off-by: default avatarDavid Teigland <teigland@redhat.com>
      Signed-off-by: default avatarSteven Whitehouse <swhiteho@redhat.com>
      79d72b54
    • David Teigland's avatar
      [DLM] cancel in conversion deadlock [4/6] · c85d65e9
      David Teigland authored
      When conversion deadlock is detected, cancel the conversion and return
      EDEADLK to the application.  This is a new default behavior where before
      the dlm would allow the deadlock to exist indefinately.
      
      The DLM_LKF_NODLCKWT flag can now be used in a conversion to prevent the
      dlm from performing conversion deadlock detection/cancelation on it.
      The DLM_LKF_CONVDEADLK flag can continue to be used as before to tell the
      dlm to demote the granted mode of the lock being converted if it gets into
      a conversion deadlock.
      Signed-off-by: default avatarDavid Teigland <teigland@redhat.com>
      Signed-off-by: default avatarSteven Whitehouse <swhiteho@redhat.com>
      c85d65e9
    • David Teigland's avatar
      [DLM] dlm_device interface changes [3/6] · d7db923e
      David Teigland authored
      Change the user/kernel device interface used by libdlm:
      - Add ability for userspace to check the version of the interface.  libdlm
        can now adapt to different versions of the kernel interface.
      - Increase the size of the flags passed in a lock request so all possible
        flags can be used from userspace.
      - Add an opaque "xid" value for each lock.  This "transaction id" will be
        used later to associate locks with each other during deadlock detection.
      - Add a "timeout" value for each lock.  This is used along with the
        DLM_LKF_TIMEOUT flag.
      
      Also, remove a fragment of unused code in device_read().
      
      This patch requires updating libdlm which is backward compatible with
      older kernels.
      Signed-off-by: default avatarDavid Teigland <teigland@redhat.com>
      Signed-off-by: default avatarSteven Whitehouse <swhiteho@redhat.com>
      d7db923e
    • David Teigland's avatar
      [DLM] add lock timeouts and warnings [2/6] · 3ae1acf9
      David Teigland authored
      New features: lock timeouts and time warnings.  If the DLM_LKF_TIMEOUT
      flag is set, then the request/conversion will be canceled after waiting
      the specified number of centiseconds (specified per lock).  This feature
      is only available for locks requested through libdlm (can be enabled for
      kernel dlm users if there's a use for it.)
      
      If the new DLM_LSFL_TIMEWARN flag is set when creating the lockspace, then
      a warning message will be sent to userspace (using genetlink) after a
      request/conversion has been waiting for a given number of centiseconds
      (configurable per node).  The time warnings will be used in the future
      to do deadlock detection in userspace.
      Signed-off-by: default avatarDavid Teigland <teigland@redhat.com>
      Signed-off-by: default avatarSteven Whitehouse <swhiteho@redhat.com>
      3ae1acf9
    • David Teigland's avatar
      [DLM] block scand during recovery [1/6] · 85e86edf
      David Teigland authored
      Don't let dlm_scand run during recovery since it may try to do a resource
      directory removal while the directory nodes are changing.
      Signed-off-by: default avatarDavid Teigland <teigland@redhat.com>
      Signed-off-by: default avatarSteven Whitehouse <swhiteho@redhat.com>
      85e86edf