-
Notifications
You must be signed in to change notification settings - Fork 169
aoe: flush aoe device when finished serving #412
base: master
Are you sure you want to change the base?
Conversation
lpabon
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please add a comment to why this is necessary for others to understand at some future date.
cmd/torusblk/aoe.go
Outdated
| if err = as.Serve(ai); err != nil { | ||
| return fmt.Errorf("Failed to serve AoE: %v", err) | ||
| } | ||
| defer flush(fmt.Sprintf("e%d.%d", minor, major)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why use defer?
|
Sure, I updated and added the comment. |
|
Yes, I did verify it. (test record)1. Start and stop torusblk with aoe block device[vagrant@torus1 torus]$ sudo ./bin/torusblk aoe test1 --debug lo 1 1 2. Confirm /dev/etherd/e1.1 has been removed[vagrant@torus1 torus]$ ls /dev/etherd/p 3. fdisk works[vagrant@torus1 torus]$ sudo fdisk -l > /dev/null |
|
lgtm. defer to @lpabon |
|
would this be better as a defer, or possibly in the aoe server's Close()? |
|
I got a review #412 (comment) before. And I agreed with reviewer that there are no reason to use defer. For the idea of aoe server's Close(), |
fixes #389