瀏覽代碼

ceph: fix open file counting on snapped inodes when mds returns no caps

It's possible the MDS will not issue caps on a snapped inode, in which case
an open request may not __ceph_get_fmode(), botching the open file
counting.  (This is actually a server bug, but the client shouldn't BUG out
in this case.)

Signed-off-by: Sage Weil <sage@newdream.net>
Sage Weil 15 年之前
父節點
當前提交
04d000eb35
共有 1 個文件被更改,包括 4 次插入0 次删除
  1. 4 0
      fs/ceph/inode.c

+ 4 - 0
fs/ceph/inode.c

@@ -733,6 +733,10 @@ no_change:
 				__ceph_get_fmode(ci, cap_fmode);
 				__ceph_get_fmode(ci, cap_fmode);
 			spin_unlock(&inode->i_lock);
 			spin_unlock(&inode->i_lock);
 		}
 		}
+	} else if (cap_fmode >= 0) {
+		pr_warning("mds issued no caps on %llx.%llx\n",
+			   ceph_vinop(inode));
+		__ceph_get_fmode(ci, cap_fmode);
 	}
 	}
 
 
 	/* update delegation info? */
 	/* update delegation info? */