1. 09 7月, 2007 40 次提交
    • D
      [DLM] don't require FS flag on all nodes · fad59c13
      David Teigland 提交于
      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: NPatrick Caulfield <pcaulfie@redhat.com>
      Signed-off-by: NDavid Teigland <teigland@redhat.com>
      Signed-off-by: NSteven Whitehouse <swhiteho@redhat.com>
      fad59c13
    • A
      [GFS2] Fix deallocation issues · d93cfa98
      Abhijith Das 提交于
      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: NAbhijith Das <adas@redhat.com>
      Signed-off-by: NSteven Whitehouse <swhiteho@redhat.com>
      d93cfa98
    • D
      [GFS2] return conflicts for GETLK · a7a2ff8a
      David Teigland 提交于
      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: NSteven Whitehouse <swhiteho@redhat.com>
      a7a2ff8a
    • D
      [GFS2] set plock owner in GETLK info · d88101d4
      David Teigland 提交于
      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: NDavid Teigland <teigland@redhat.com>
      Signed-off-by: NSteven Whitehouse <swhiteho@redhat.com>
      d88101d4
    • A
      [GFS2] gfs2_lookupi() uninitialised var fix · 037bcbb7
      akpm@linux-foundation.org 提交于
      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: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NSteven Whitehouse <swhiteho@redhat.com>
      037bcbb7
    • S
      [GFS2] Recovery for lost unlinked inodes · c8cdf479
      Steven Whitehouse 提交于
      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: NSteven Whitehouse <swhiteho@redhat.com>
      c8cdf479
    • R
      [GFS2] Can't mount GFS2 file system on AoE device · b35997d4
      Robert Peterson 提交于
      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: NBob Peterson <rpeterso@redhat.com>
      Signed-off-by: NSteven Whitehouse <swhiteho@redhat.com>
      b35997d4
    • S
      [GFS2] Fix bug in error path of inode · e1cc8603
      Steven Whitehouse 提交于
      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: NSteven Whitehouse <swhiteho@redhat.com>
      e1cc8603
    • S
      [GFS2] Fix typo in rename of directories · ffed8ab3
      Steven Whitehouse 提交于
      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: NSteven Whitehouse <swhiteho@redhat.com>
      ffed8ab3
    • P
      [DLM] variable allocation · 44f487a5
      Patrick Caulfield 提交于
      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: NPatrick Caulfield <pcaulfie@redhat.com>
      Signed-Off-By: NDavid Teigland <teigland@redhat.com>
      Signed-off-by: NSteven Whitehouse <swhiteho@redhat.com>
      44f487a5
    • J
      [DLM] fix reference counting · 292e539e
      Josef Bacik 提交于
      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: NJosef Bacik <jwhiter@redhat.com>
      Signed-off-by: NSteven Whitehouse <swhiteho@redhat.com>
      292e539e
    • S
      [GFS2] Add nanosecond timestamp feature · 4bd91ba1
      Steven Whitehouse 提交于
      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: NSteven Whitehouse <swhiteho@redhat.com>
      4bd91ba1
    • S
      [GFS2] Fix sign problem in quota/statfs and cleanup _host structures · bb8d8a6f
      Steven Whitehouse 提交于
      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: NSteven Whitehouse <swhiteho@redhat.com>
      bb8d8a6f
    • B
      [GFS2] fix jdata issues · ddf4b426
      Benjamin Marzinski 提交于
      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: NBenjamin Marzinski <bmarzins@redhat.com>
      Signed-off-by: NSteven Whitehouse <swhiteho@redhat.com>
      ddf4b426
    • P
      [DLM] fix socket shutdown · afb853fb
      Patrick Caulfield 提交于
      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: NPatrick Caulfield <pcaulfie@redhat.com>
      Signed-Off-By: NDavid Teigland <teigland@redhat.com>
      Signed-off-by: NSteven Whitehouse <swhiteho@redhat.com>
      afb853fb
    • S
      [GFS2] Make the log reserved blocks depend on block size · 89918647
      Steven Whitehouse 提交于
      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: NSteven Whitehouse <swhiteho@redhat.com>
      89918647
    • A
      [GFS2] Quotas non-functional - fix another bug · 1990e917
      Abhijith Das 提交于
      This patch fixes a bug where gfs2 was writing update quota usage
      information to the wrong location in the quota file.
      Signed-off-by: NAbhijith Das <adas@redhat.com>
      Signed-off-by: NSteven Whitehouse <swhiteho@redhat.com>
      1990e917
    • D
      [DLM] show default protocol · 0b7cac0f
      David Teigland 提交于
      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: NDavid Teigland <teigland@redhat.com>
      Signed-off-by: NSteven Whitehouse <swhiteho@redhat.com>
      0b7cac0f
    • D
      [DLM] dumping master locks · 9dd592d7
      David Teigland 提交于
      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: NDavid Teigland <teigland@redhat.com>
      Signed-off-by: NSteven Whitehouse <swhiteho@redhat.com>
      9dd592d7
    • D
      [DLM] canceling deadlocked lock · 8b4021fa
      David Teigland 提交于
      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: NDavid Teigland <teigland@redhat.com>
      Signed-off-by: NSteven Whitehouse <swhiteho@redhat.com>
      8b4021fa
    • D
      [DLM] timeout fixes · 84d8cd69
      David Teigland 提交于
      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: NDavid Teigland <teigland@redhat.com>
      Signed-off-by: NSteven Whitehouse <swhiteho@redhat.com>
      84d8cd69
    • S
      [DLM] Compile fix · b3cab7b9
      Steven Whitehouse 提交于
      A one liner fix which got missed from the earlier patches.
      Signed-off-by: NSteven Whitehouse <swhiteho@redhat.com>
      Cc: Fabio Massimo Di Nitto <fabbione@ubuntu.com>
      Cc: David Teigland <teigland@redhat.com>
      b3cab7b9
    • D
      [DLM] fix compile breakage · 639aca41
      David Teigland 提交于
      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: NDavid Teigland <teigland@redhat.com>
      Signed-off-by: NSteven Whitehouse <swhiteho@redhat.com>
      639aca41
    • D
      [DLM] wait for config check during join [6/6] · 8b0e7b2c
      David Teigland 提交于
      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: NDavid Teigland <teigland@redhat.com>
      Signed-off-by: NSteven Whitehouse <swhiteho@redhat.com>
      8b0e7b2c
    • D
      [DLM] fix new_lockspace error exit [5/6] · 79d72b54
      David Teigland 提交于
      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: NDavid Teigland <teigland@redhat.com>
      Signed-off-by: NSteven Whitehouse <swhiteho@redhat.com>
      79d72b54
    • D
      [DLM] cancel in conversion deadlock [4/6] · c85d65e9
      David Teigland 提交于
      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: NDavid Teigland <teigland@redhat.com>
      Signed-off-by: NSteven Whitehouse <swhiteho@redhat.com>
      c85d65e9
    • D
      [DLM] dlm_device interface changes [3/6] · d7db923e
      David Teigland 提交于
      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: NDavid Teigland <teigland@redhat.com>
      Signed-off-by: NSteven Whitehouse <swhiteho@redhat.com>
      d7db923e
    • D
      [DLM] add lock timeouts and warnings [2/6] · 3ae1acf9
      David Teigland 提交于
      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: NDavid Teigland <teigland@redhat.com>
      Signed-off-by: NSteven Whitehouse <swhiteho@redhat.com>
      3ae1acf9
    • D
      [DLM] block scand during recovery [1/6] · 85e86edf
      David Teigland 提交于
      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: NDavid Teigland <teigland@redhat.com>
      Signed-off-by: NSteven Whitehouse <swhiteho@redhat.com>
      85e86edf
    • J
      [DLM] keep dlm from panicing when traversing rsb list in debugfs · 916297aa
      Josef Bacik 提交于
      This problem was originally reported against GFS6.1, but the same issue exists
      in upstream DLM.  This patch keeps the rsb iterator assigning under the rsbtbl
      list lock.  Each time we process an rsb we grab a reference to it to make sure
      it is not freed out from underneath us, and then put it when we get the next rsb
      in the list or move onto another list.
      Signed-off-by: NJosef Bacik <jwhiter@redhat.com>
      Signed-off-by: NSteven Whitehouse <swhiteho@redhat.com>
      916297aa
    • A
      [GFS2] Quotas non-functional - fix bug · 2a87ab08
      Abhijith Das 提交于
      This patch fixes an error in the quota code where a 'struct
      gfs2_quota_lvb*' was being passed to gfs2_adjust_quota() instead of a
      'struct gfs2_quota_data*'. Also moved 'struct gfs2_quota_lvb' from
      fs/gfs2/incore.h to include/linux/gfs2_ondisk.h as per Steve's suggestion.
      Signed-off-by: NAbhijith Das <adas@redhat.com>
      Signed-off-by: NSteven Whitehouse <swhiteho@redhat.com>
      2a87ab08
    • S
      [GFS2] Clean up inode number handling · dbb7cae2
      Steven Whitehouse 提交于
      This patch cleans up the inode number handling code. The main difference
      is that instead of looking up the inodes using a struct gfs2_inum_host
      we now use just the no_addr member of this structure. The tests relating
      to no_formal_ino can then be done by the calling code. This has
      advantages in that we want to do different things in different code
      paths if the no_formal_ino doesn't match. In the NFS patch we want to
      return -ESTALE, but in the ->lookup() path, its a bug in the fs if the
      no_formal_ino doesn't match and thus we can withdraw in this case.
      
      In order to later fix bz #201012, we need to be able to look up an inode
      without knowing no_formal_ino, as the only information that is known to
      us is the on-disk location of the inode in question.
      
      This patch will also help us to fix bz #236099 at a later date by
      cleaning up a lot of the code in that area.
      
      There are no user visible changes as a result of this patch and there
      are no changes to the on-disk format either.
      Signed-off-by: NSteven Whitehouse <swhiteho@redhat.com>
      dbb7cae2
    • S
      [GFS2] Reduce size of struct gdlm_lock · 41d7db0a
      Steven Whitehouse 提交于
      This patch removes the completion (which is rather large) from struct
      gdlm_lock in favour of using the wait_on_bit() functions. We don't need
      to add any extra fields to the structure to do this, so we save 32 bytes
      (on x86_64) per structure. This adds up to quite a lot when we may
      potentially have millions of these lock structures,
      Signed-off-by: NSteven Whitehouse <swhiteho@redhat.com>
      Acked-by: NDavid Teigland <teigland@redhat.com>
      41d7db0a
    • R
      [GFS2] Addendum patch 2 for gfs2_grow · cd81a4ba
      Robert Peterson 提交于
      This addendum patch 2 corrects three things:
      
      1. It fixes a stupid mistake in the previous addendum that broke gfs2.
         Ref: https://www.redhat.com/archives/cluster-devel/2007-May/msg00162.html
      2. It fixes a problem that Dave Teigland pointed out regarding the
         external declarations in ops_address.h being in the wrong place.
      3. It recasts a couple more %llu printks to (unsigned long long)
         as requested by Steve Whitehouse.
      
      I would have loved to put this all in one revised patch, but there was
      a rush to get some patches for RHEL5.	Therefore, the previous patches
      were applied to the git tree "as is" and therefore, I'm posting another
      addendum.  Sorry.
      Signed-off-by: NBob Peterson <rpeterso@redhat.com>
      Signed-off-by: NSteven Whitehouse <swhiteho@redhat.com>
      cd81a4ba
    • N
      [GFS2] use zero_user_page · 0507ecf5
      Nate Diller 提交于
      Use zero_user_page() instead of open-coding it.
      Signed-off-by: NNate Diller <nate.diller@gmail.com>
      Cc: Steven Whitehouse <swhiteho@redhat.com>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      0507ecf5
    • R
      [GFS2] Kernel changes to support new gfs2_grow command (part 2) · 6c53267f
      Robert Peterson 提交于
      To avoid code redundancy, I separated out the operational "guts" into
      a new function called read_rindex_entry.  Then I made two functions:
      the closer-to-original gfs2_ri_update (without the special condition
      checks) and gfs2_ri_update_special that's designed with that condition
      in mind.  (I don't like the name, but if you have a suggestion, I'm
      all ears).
      
      Oh, and there's an added benefit:  we don't need all the ugly gotos
      anymore.  ;)
      
      This patch has been tested with gfs2_fsck_hellfire (which runs for
      three and a half hours, btw).
      Signed-off-By: NBob Peterson <rpeterso@redhat.com>
      Signed-off-by: NSteven Whitehouse <swhiteho@redhat.com>
      6c53267f
    • R
      [GFS2] kernel changes to support new gfs2_grow command · 7ae8fa84
      Robert Peterson 提交于
      This is another revision of my gfs2 kernel patch that allows
      gfs2_grow to function properly.
      
      Steve Whitehouse expressed some concerns about the previous
      patch and I restructured it based on his comments.
      The previous patch was doing the statfs_change at file close time,
      under its own transaction.  The current patch does the statfs_change
      inside the gfs2_commit_write function, which keeps it under the
      umbrella of the inode transaction.
      
      I can't call ri_update to re-read the rindex file during the
      transaction because the transaction may have outstanding unwritten
      buffers attached to the rgrps that would be otherwise blown away.
      So instead, I created a new function, gfs2_ri_total, that will
      re-read the rindex file just to total the file system space
      for the sake of the statfs_change.  The ri_update will happen
      later, when gfs2 realizes the version number has changed, as it
      happened before my patch.
      
      Since the statfs_change is happening at write_commit time and there
      may be multiple writes to the rindex file for one grow operation.
      So one consequence of this restructuring is that instead of getting
      one kernel message to indicate the change, you may see several.
      For example, before when you did a gfs2_grow, you'd get a single
      message like:
      
      GFS2: File system extended by 247876 blocks (968MB)
      
      Now you get something like:
      
      GFS2: File system extended by 207896 blocks (812MB)
      GFS2: File system extended by 39980 blocks (156MB)
      
      This version has also been successfully run against the hours-long
      "gfs2_fsck_hellfire" test that does several gfs2_grow and gfs2_fsck
      while interjecting file system damage.  It does this repeatedly
      under a variety Resource Group conditions.
      Signed-off-By: NBob Peterson <rpeterso@redhat.com>
      Signed-off-by: NSteven Whitehouse <swhiteho@redhat.com>
      7ae8fa84
    • S
      [DLM] fix a couple of races · 3168b078
      Satyam Sharma 提交于
      Fix two races in fs/dlm/config.c:
      
      (1) Grab the configfs subsystem semaphore before calling
      config_group_find_obj() in get_space(). This solves a potential race
      between get_space() and concurrent mkdir(2) or rmdir(2).
      
      (2) Grab a reference on the found config_item _while_ holding the configfs
      subsystem semaphore in get_comm(), and not after it. This solves a
      potential race between get_comm() and concurrent rmdir(2).
      Signed-off-by: NSatyam Sharma <ssatyam@cse.iitk.ac.in>
      Signed-off-by: NDavid Teigland <teigland@redhat.com>
      Signed-off-by: NSteven Whitehouse <swhiteho@redhat.com>
      3168b078
    • B
      [GFS2] flush the glock completely in inode_go_sync · b524fe64
      Benjamin Marzinski 提交于
      Fix for bz #231910
      When filemap_fdatawrite() is called on the inode mapping in data=ordered mode,
      it will add the glock to the log. In inode_go_sync(), if you do the
      gfs2_log_flush() before this, after the filemap_fdatawrite() call, the glock
      and its associated data buffers will be on the log again. This means you can
      demote a lock from exclusive, without having it flushed from the log. The
      attached patch simply moves the gfs2_log_flush up to after the
      filemap_fdatawrite() call.
      
      Originally, I tried moving the gfs2_log_flush to after gfs2_meta_sync(), but
      that caused me to trip the following assert.
      
      GFS2: fsid=cypher-36:test.0: fatal: assertion "!buffer_busy(bh)" failed
      GFS2: fsid=cypher-36:test.0:   function = gfs2_ail_empty_gl, file = fs/gfs2/glops.c, line = 61
      
      It appears that gfs2_log_flush() puts some of the glocks buffers in the busy
      state and the filemap_fdatawrite() call is necessary to flush them. This makes
      me worry slightly that a related problem could happen because of moving the
      gfs2_log_flush() after the initial filemap_fdatawrite(), but I assume that
      gfs2_ail_empty_gl() would catch that case as well.
      Signed-off-by: NBenjamin E. Marzinski <bmarzins@redhat.com>
      Signed-off-by: NSteven Whitehouse <swhiteho@redhat.com>
      b524fe64
    • L
      Fix permission checking for the new utimensat() system call · 1e5de283
      Linus Torvalds 提交于
      Commit 1c710c89 added the utimensat()
      system call, but didn't handle the case of checking for the writability
      of the target right, when the target was a file descriptor, not a
      filename.
      
      We cannot use vfs_permission(MAY_WRITE) for that case, and need to
      simply check whether the file descriptor is writable.  The oops from
      using the wrong function was noticed and narrowed down by Markus
      Trippelsdorf.
      
      Cc: Ulrich Drepper <drepper@redhat.com>
      Cc: Markus Trippelsdorf <markus@trippelsdorf.de>
      Cc: Andrew Morton <akpm@linux-foundation.org>
      Acked-by: NAl Viro <viro@ftp.linux.org.uk>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      1e5de283