Skip to contentSkip to conversation

nfs: remove WARN_ON_ONCE from nfs_direct_good_bytes

PATCH In review Peng Tao 2 participants 2 messages Apr 8, 2015

Subsystems (2)
lore
Share & tools
lore

Peng Tao

author
#0 lore raw

PATCH 1/1 nfs: remove WARN_ON_ONCE from nfs_direct_good_bytes

For flexfiles driver, we might choose to read from mirror index other than 0 while mirror_count is always 1 for read.

---
 fs/nfs/direct.c | 2 --
 1 file changed, 2 deletions(-)
fs/nfs/direct.c +0 -2
index 645109e..0c84f67 100644
@@ -129,8 +129,6 @@ nfs_direct_good_bytes(struct nfs_direct_req *dreq, struct nfs_pgio_header *hdr)
 	int i;
 	ssize_t count;
 
-	WARN_ON_ONCE(hdr->pgio_mirror_idx >= dreq->mirror_count);
-
 	count = dreq->mirrors[hdr->pgio_mirror_idx].count;
 	if (count + dreq->io_start < hdr->io_start + hdr->good_bytes)
 		dreq->mirrors[hdr->pgio_mirror_idx].count += hdr->good_bytes;
Signature · 1 line
1.9.1
#1 lore raw

Makes sense to me!

Thanks,
-dros

Quoted 28 lines · Peng Tao

For flexfiles driver, we might choose to read from mirror index other than 0 while mirror_count is always 1 for read.

---
fs/nfs/direct.c | 2 --

1 file changed, 2 deletions(-)
fs/nfs/direct.c +0 -2
index 645109e..0c84f67 100644
@@ -129,8 +129,6 @@ nfs_direct_good_bytes(struct nfs_direct_req *dreq, struct nfs_pgio_header *hdr)
 	int i;
 	ssize_t count;
 
-	WARN_ON_ONCE(hdr->pgio_mirror_idx >= dreq->mirror_count);
-
 	count = dreq->mirrors[hdr->pgio_mirror_idx].count;
 	if (count + dreq->io_start < hdr->io_start + hdr->good_bytes)
 		dreq->mirrors[hdr->pgio_mirror_idx].count += hdr->good_bytes;
Signature · 1 line
1.9.1