Skip to contentSkip to conversation

ceph: remove dead code in ceph_sync_write

PATCH In review Jeff Layton 3 participants 4 messages Aug 11, 2021 Ceph client

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 ceph: remove dead code in ceph_sync_write

We've already checked these flags near the top of the function and bailed out if either were set.

---
 fs/ceph/file.c | 6 +-----
 1 file changed, 1 insertion(+), 5 deletions(-)
fs/ceph/file.c +1 -5
index d1755ac1d964..f55ca2c4c7de 100644
@@ -1834,12 +1834,8 @@ static ssize_t ceph_write_iter(struct kiocb *iocb, struct iov_iter *from)
 		goto retry_snap;
 	}
 
-	if (written >= 0) {
-		if ((map_flags & CEPH_OSDMAP_NEARFULL) ||
-		    (pool_flags & CEPH_POOL_FLAG_NEARFULL))
-			iocb->ki_flags |= IOCB_DSYNC;
+	if (written >= 0)
 		written = generic_write_sync(iocb, written);
-	}
 
 	goto out_unlocked;
 out:
Signature · 1 line
2.31.1
#1 lore raw
Quoted 2 lines · Jeff Layton

We've already checked these flags near the top of the function and bailed out if either were set.

The flags being checked at the top of the function are CEPH_OSDMAP_FULL and CEPH_POOL_FLAG_FULL; here we're checking the *_NEARFULL flags. Right? (I had to look a few times to make sure my eyes were not lying.)

Cheers,

Signature · 1 line
Luis
Quoted 28 lines
---
 fs/ceph/file.c | 6 +-----
 1 file changed, 1 insertion(+), 5 deletions(-)
fs/ceph/file.c +1 -5
index d1755ac1d964..f55ca2c4c7de 100644
@@ -1834,12 +1834,8 @@ static ssize_t ceph_write_iter(struct kiocb *iocb, struct iov_iter *from)
 		goto retry_snap;
 	}
 
-	if (written >= 0) {
-		if ((map_flags & CEPH_OSDMAP_NEARFULL) ||
-		    (pool_flags & CEPH_POOL_FLAG_NEARFULL))
-			iocb->ki_flags |= IOCB_DSYNC;
+	if (written >= 0)
 		written = generic_write_sync(iocb, written);
-	}
 
 	goto out_unlocked;
 out:
Signature · 1 line
2.31.1
#2 lore raw
Quoted 10 lines · Luis Henriques
Quoted 2 lines · Jeff Layton

We've already checked these flags near the top of the function and bailed out if either were set.

The flags being checked at the top of the function are CEPH_OSDMAP_FULL and CEPH_POOL_FLAG_FULL; here we're checking the *_NEARFULL flags. Right? (I had to look a few times to make sure my eyes were not lying.)

Cheers,

Oof. You're totally right. Dropping this patch!

Thanks,

Signature · 1 line
Jeff Layton <[email protected]>
maintainer
#3 lore raw
Quoted 7 lines · Jeff Layton
Quoted 5 lines · Luis Henriques
Quoted 2 lines · Jeff Layton

We've already checked these flags near the top of the function and bailed out if either were set.

Quoted 7 lines
Quoted 5 lines

The flags being checked at the top of the function are CEPH_OSDMAP_FULL and CEPH_POOL_FLAG_FULL; here we're checking the *_NEARFULL flags. Right? (I had to look a few times to make sure my eyes were not lying.)

Cheers,

Oof. You're totally right. Dropping this patch!

But it would have made https://github.com/ceph/ceph/pull/42749
unfounded! ;)

Thanks,

Ilya