History

lightnvm: track inflight target creations

When creation process is still in progress, target is not yet on targets list. This causes a chance for removing whole lightnvm subsystem by calling nvm_unregister() in the meantime and finally by causing kernel panic inside target init function. This patch changes the behaviour by adding kref variable which tracks all the users of nvm_dev structure. When nvm_dev is allocated, kref value is set to 1. Then before every target creation the value is increased and decreased after target removal. The extra reference is decreased when nvm subsystem is unregistered.

Igor Konopko committed 7 years ago

Commit e69397e1 parent a24eab52 files · +32 −10Browse files

Showing the changes to include/linux (1 of 2 files). Show all

Unified · Split

include/linux/lightnvm.h+1−0
@@ -428,6 +428,7 @@ struct nvm_dev { · 427 unmodified lines
428428 char name[DISK_NAME_LEN];
429429 void *private_data;
430430
431+ struct kref ref;
431432 void *rmap;
432433
433434 struct mutex mlock;

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t