Skip to contentSkip to conversation

how to know when all space from a snapshot delete is freed?

DISCUSSION Brian J. Murrell 3 participants 4 messages Mar 2, 2011 Btrfs file system

lore
Share & tools
lore
#0 lore raw

For some time after I issue a snapshot delete, the space in the volume is freed. It starts to free quite fast and then the progress slows and speeds up again.

Given that the return from the snapshot delete command is immediate and the space is freed asynchronously, how can I determine absolutely that the snapshot has been entirely removed and the space freeing operation is complete?

Cheers,
b.

#1 lore raw

David worked for some time to a solution to this kind of problem. But I don't know if it was merged.

See posts on this ML with subject "PATCH: IOCTL#21 progs"

Quoted 12 lines · Brian J. Murrell

For some time after I issue a snapshot delete, the space in the volume is freed. It starts to free quite fast and then the progress slows and speeds up again.

Given that the return from the snapshot delete command is immediate and the space is freed asynchronously, how can I determine absolutely that the snapshot has been entirely removed and the space freeing operation is complete?

Cheers,
b.

#2 lore raw

the patch has been working in production at the sponsor's site for some weeks. It has not been merged, or even built by anyone else, to my knowledge.

The working kernel patch is at https://patchwork.kernel.org/patch/482721/

The open question, that everyone has more important things to do than talk about, is, to flesh out the iputs stuff or discard it or put it in as-is. That question is orthogonal to the function of the notification-of-completed-dead-root-removal parts, which are complete and work as designed.

Quoted 4 lines · Goffredo Baroncelli

David worked for some time to a solution to this kind of problem. But I don't know if it was merged.

See posts on this ML with subject "PATCH: IOCTL#21 progs"

Signature · 2 lines
"Reasonable, civil, and intelligent people have not left much of a
mark on history." -- T. Herman Zweibel
#3 lore raw
In reply to Brian J. Murrell
Quoted 7 lines · Brian J. Murrell

Given that the return from the snapshot delete command is immediate and the space is freed asynchronously, how can I determine absolutely that the snapshot has been entirely removed and the space freeing operation is complete?

Cheers,
b.

since you just want to determine, and not wait, patch your kernel, then invoke ioctl#21 with flags of 0x0000 and timeout of 0x0001. you will have an answer in approximately one millisecond.

Signature · 2 lines
"Reasonable, civil, and intelligent people have not left much of a
mark on history." -- T. Herman Zweibel