瀏覽代碼

pNFS: Always update the layout stateid if NFS_LAYOUT_INVALID_STID is set

If the layout stateid is invalid, then pnfs_set_layout_stateid() must
always initialise it.

Signed-off-by: Trond Myklebust <trond.myklebust@primarydata.com>
Trond Myklebust 9 年之前
父節點
當前提交
13bede18de
共有 1 個文件被更改,包括 1 次插入1 次删除
  1. 1 1
      fs/nfs/pnfs.c

+ 1 - 1
fs/nfs/pnfs.c

@@ -762,7 +762,7 @@ pnfs_set_layout_stateid(struct pnfs_layout_hdr *lo, const nfs4_stateid *new,
 			bool update_barrier)
 			bool update_barrier)
 {
 {
 	u32 oldseq, newseq, new_barrier;
 	u32 oldseq, newseq, new_barrier;
-	int empty = list_empty(&lo->plh_segs);
+	bool empty = !pnfs_layout_is_valid(lo);
 
 
 	oldseq = be32_to_cpu(lo->plh_stateid.seqid);
 	oldseq = be32_to_cpu(lo->plh_stateid.seqid);
 	newseq = be32_to_cpu(new->seqid);
 	newseq = be32_to_cpu(new->seqid);