Merge branch 'upstream-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jlbec...
authorLinus Torvalds <torvalds@linux-foundation.org>
Mon, 24 Aug 2009 21:41:28 +0000 (14:41 -0700)
committerLinus Torvalds <torvalds@linux-foundation.org>
Mon, 24 Aug 2009 21:41:28 +0000 (14:41 -0700)
* 'upstream-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jlbec/ocfs2:
  ocfs2/dlm: Wait on lockres instead of erroring cancel requests
  ocfs2: Add missing lock name
  ocfs2: Don't oops in ocfs2_kill_sb on a failed mount
  ocfs2: release the buffer head in ocfs2_do_truncate.
  ocfs2: Handle quota file corruption more gracefully

fs/ocfs2/alloc.c
fs/ocfs2/dlm/dlmunlock.c
fs/ocfs2/ocfs2_lockid.h
fs/ocfs2/quota_global.c
fs/ocfs2/super.c

index f9a3e8942669f436ad64fa00b550a46f34cd44be..ab513ddaeff2f6944c5f0d54356e7484fa63cfeb 100644 (file)
@@ -6851,7 +6851,7 @@ static int ocfs2_do_truncate(struct ocfs2_super *osb,
        }
        status = 0;
 bail:
-
+       brelse(last_eb_bh);
        mlog_exit(status);
        return status;
 }
index fcf879ed69308e9518d0504428d3afbe13ee9f8f..756f5b0998e0d4e389ffcda4b558f861094eeb91 100644 (file)
@@ -122,7 +122,7 @@ static enum dlm_status dlmunlock_common(struct dlm_ctxt *dlm,
         * that still has AST's pending... */
        in_use = !list_empty(&lock->ast_list);
        spin_unlock(&dlm->ast_lock);
-       if (in_use) {
+       if (in_use && !(flags & LKM_CANCEL)) {
               mlog(ML_ERROR, "lockres %.*s: Someone is calling dlmunlock "
                    "while waiting for an ast!", res->lockname.len,
                    res->lockname.name);
@@ -131,7 +131,7 @@ static enum dlm_status dlmunlock_common(struct dlm_ctxt *dlm,
 
        spin_lock(&res->spinlock);
        if (res->state & DLM_LOCK_RES_IN_PROGRESS) {
-               if (master_node) {
+               if (master_node && !(flags & LKM_CANCEL)) {
                        mlog(ML_ERROR, "lockres in progress!\n");
                        spin_unlock(&res->spinlock);
                        return DLM_FORWARD;
index fcdba091af3dd8be6706950e83a772049bf775b1..c212cf5a2bdf3ad9e8e6c02672f4b76189202f5a 100644 (file)
@@ -108,6 +108,7 @@ static char *ocfs2_lock_type_strings[] = {
        [OCFS2_LOCK_TYPE_OPEN] = "Open",
        [OCFS2_LOCK_TYPE_FLOCK] = "Flock",
        [OCFS2_LOCK_TYPE_QINFO] = "Quota",
+       [OCFS2_LOCK_TYPE_NFS_SYNC] = "NFSSync",
        [OCFS2_LOCK_TYPE_ORPHAN_SCAN] = "OrphanScan",
 };
 
index bf7742d0ee3bba05a7ceabab948aff62f27482f0..44f2a5e1d04233bae9fc5b72bf894cbdd67461f2 100644 (file)
@@ -23,6 +23,7 @@
 #include "sysfile.h"
 #include "dlmglue.h"
 #include "uptodate.h"
+#include "super.h"
 #include "quota.h"
 
 static struct workqueue_struct *ocfs2_quota_wq = NULL;
@@ -114,6 +115,15 @@ int ocfs2_read_quota_block(struct inode *inode, u64 v_block,
        int rc = 0;
        struct buffer_head *tmp = *bh;
 
+       if (i_size_read(inode) >> inode->i_sb->s_blocksize_bits <= v_block) {
+               ocfs2_error(inode->i_sb,
+                           "Quota file %llu is probably corrupted! Requested "
+                           "to read block %Lu but file has size only %Lu\n",
+                           (unsigned long long)OCFS2_I(inode)->ip_blkno,
+                           (unsigned long long)v_block,
+                           (unsigned long long)i_size_read(inode));
+               return -EIO;
+       }
        rc = ocfs2_read_virt_blocks(inode, v_block, 1, &tmp, 0,
                                    ocfs2_validate_quota_block);
        if (rc)
index b0ee0fdf799a514c9555b34f4983c734825badde..a3f8871d21fd516fb29aefbc040e30e6be016069 100644 (file)
@@ -1218,13 +1218,17 @@ static void ocfs2_kill_sb(struct super_block *sb)
 {
        struct ocfs2_super *osb = OCFS2_SB(sb);
 
+       /* Failed mount? */
+       if (!osb || atomic_read(&osb->vol_state) == VOLUME_DISABLED)
+               goto out;
+
        /* Prevent further queueing of inode drop events */
        spin_lock(&dentry_list_lock);
        ocfs2_set_osb_flag(osb, OCFS2_OSB_DROP_DENTRY_LOCK_IMMED);
        spin_unlock(&dentry_list_lock);
        /* Wait for work to finish and/or remove it */
        cancel_work_sync(&osb->dentry_lock_work);
-
+out:
        kill_block_super(sb);
 }