Skip to contentSkip to conversation

btrfs: send: add otime support to send_utimes()

PATCH In review Hamza Mahfooz 2 participants 2 messages Oct 5, 2021 Btrfs file system

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 btrfs: send: add otime support to send_utimes()

Commit 766702ef49b8 ("Btrfs: add/fix comments/documentation for send/receive") suggests that, otime support should be added to send_utimes() after btrfs gets otime support. So, since btrfs has had otime support for many years, we should add otime support to send_utimes().

---
 fs/btrfs/send.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
fs/btrfs/send.c +1 -1
index 72f9b865e847..0bee9f7a45da 100644
@@ -2544,7 +2544,7 @@ static int send_utimes(struct send_ctx *sctx, u64 ino, u64 gen)
 	TLV_PUT_BTRFS_TIMESPEC(sctx, BTRFS_SEND_A_ATIME, eb, &ii->atime);
 	TLV_PUT_BTRFS_TIMESPEC(sctx, BTRFS_SEND_A_MTIME, eb, &ii->mtime);
 	TLV_PUT_BTRFS_TIMESPEC(sctx, BTRFS_SEND_A_CTIME, eb, &ii->ctime);
-	/* TODO Add otime support when the otime patches get into upstream */
+	TLV_PUT_BTRFS_TIMESPEC(sctx, BTRFS_SEND_A_OTIME, eb, &ii->otime);
 
 	ret = send_cmd(sctx);
 
Signature · 1 line
2.33.0
#1 lore raw
Quoted 15 lines · Hamza Mahfooz

Commit 766702ef49b8 ("Btrfs: add/fix comments/documentation for send/receive") suggests that, otime support should be added to send_utimes() after btrfs gets otime support. So, since btrfs has had otime support for many years, we should add otime support to send_utimes().

---
 fs/btrfs/send.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
fs/btrfs/send.c +0 -0
index 72f9b865e847..0bee9f7a45da 100644

fs/btrfs/send.c static int send_utimes(struct send_ctx *sctx, u64 ino, u64 gen) · line 2547

Quoted 4 lines
fs/btrfs/send.c +0 -1
@@ -2544,7 +2544,7 @@ static int send_utimes(struct send_ctx *sctx, u64 ino, u64 gen)
 	TLV_PUT_BTRFS_TIMESPEC(sctx, BTRFS_SEND_A_ATIME, eb, &ii->atime);
 	TLV_PUT_BTRFS_TIMESPEC(sctx, BTRFS_SEND_A_MTIME, eb, &ii->mtime);
 	TLV_PUT_BTRFS_TIMESPEC(sctx, BTRFS_SEND_A_CTIME, eb, &ii->ctime);
-	/* TODO Add otime support when the otime patches get into upstream */

Are you going after TODOs in the btrfs code? Some of them are stale or don't reveal the real scope of the required changes.

fs/btrfs/send.c static int send_utimes(struct send_ctx *sctx, u64 ino, u64 gen) · line 2547

Quoted 1 line
fs/btrfs/send.c +1 -0
+	TLV_PUT_BTRFS_TIMESPEC(sctx, BTRFS_SEND_A_OTIME, eb, &ii->otime);

For example this adds a new data to 'utimes' in the protocol v1, which would require a major update. One such update is in progress and would probably gather all pending updates though I'm not sure is this one in particular is there.

So the reason why it can't be done by that is that the send steam would be invalid and would break the receive. Also, testing changes is good.