Merge tag 'for-4.21/block-20190102' of git://git.kernel.dk/linux-block
Pull more block updates from Jens Axboe: - Dead code removal for loop/sunvdc (Chengguang) - Mark BIDI support for bsg as deprecated, logging a single dmesg warning if anyone is actually using it (Christoph) - blkcg cleanup, killing a dead function and making the tryget_closest variant easier to read (Dennis) - Floppy fixes, one fixing a regression in swim3 (Finn) - lightnvm use-after-free fix (Gustavo) - gdrom leak fix (Wenwen) - a set of drbd updates (Lars, Luc, Nathan, Roland) * tag 'for-4.21/block-20190102' of git://git.kernel.dk/linux-block: (28 commits) block/swim3: Fix regression on PowerBook G3 block/swim3: Fix -EBUSY error when re-opening device after unmount block/swim3: Remove dead return statement block/amiflop: Don't log error message on invalid ioctl gdrom: fix a memory leak bug lightnvm: pblk: fix use-after-free bug block: sunvdc: remove redundant code block: loop: remove redundant code bsg: deprecate BIDI support in bsg blkcg: remove unused __blkg_release_rcu() blkcg: clean up blkg_tryget_closest() drbd: Change drbd_request_detach_interruptible's return type to int drbd: Avoid Clang warning about pointless switch statment drbd: introduce P_ZEROES (REQ_OP_WRITE_ZEROES on the "wire") drbd: skip spurious timeout (ping-timeo) when failing promote drbd: don't retry connection if peers do not agree on "authentication" settings drbd: fix print_st_err()'s prototype to match the definition drbd: avoid spurious self-outdating with concurrent disconnect / down drbd: do not block when adjusting "disk-options" while IO is frozen drbd: fix comment typos ...
This commit is contained in:
@@ -499,22 +499,33 @@ static inline void blkg_get(struct blkcg_gq *blkg)
|
||||
*/
|
||||
static inline bool blkg_tryget(struct blkcg_gq *blkg)
|
||||
{
|
||||
return percpu_ref_tryget(&blkg->refcnt);
|
||||
return blkg && percpu_ref_tryget(&blkg->refcnt);
|
||||
}
|
||||
|
||||
/**
|
||||
* blkg_tryget_closest - try and get a blkg ref on the closet blkg
|
||||
* @blkg: blkg to get
|
||||
*
|
||||
* This walks up the blkg tree to find the closest non-dying blkg and returns
|
||||
* the blkg that it did association with as it may not be the passed in blkg.
|
||||
* This needs to be called rcu protected. As the failure mode here is to walk
|
||||
* up the blkg tree, this ensure that the blkg->parent pointers are always
|
||||
* valid. This returns the blkg that it ended up taking a reference on or %NULL
|
||||
* if no reference was taken.
|
||||
*/
|
||||
static inline struct blkcg_gq *blkg_tryget_closest(struct blkcg_gq *blkg)
|
||||
{
|
||||
while (blkg && !percpu_ref_tryget(&blkg->refcnt))
|
||||
blkg = blkg->parent;
|
||||
struct blkcg_gq *ret_blkg = NULL;
|
||||
|
||||
return blkg;
|
||||
WARN_ON_ONCE(!rcu_read_lock_held());
|
||||
|
||||
while (blkg) {
|
||||
if (blkg_tryget(blkg)) {
|
||||
ret_blkg = blkg;
|
||||
break;
|
||||
}
|
||||
blkg = blkg->parent;
|
||||
}
|
||||
|
||||
return ret_blkg;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -51,7 +51,7 @@
|
||||
#endif
|
||||
|
||||
extern const char *drbd_buildtag(void);
|
||||
#define REL_VERSION "8.4.10"
|
||||
#define REL_VERSION "8.4.11"
|
||||
#define API_VERSION 1
|
||||
#define PRO_VERSION_MIN 86
|
||||
#define PRO_VERSION_MAX 101
|
||||
|
||||
@@ -191,6 +191,7 @@ static inline void ct_assert_unique_operations(void)
|
||||
{
|
||||
switch (0) {
|
||||
#include GENL_MAGIC_INCLUDE_FILE
|
||||
case 0:
|
||||
;
|
||||
}
|
||||
}
|
||||
@@ -209,6 +210,7 @@ static inline void ct_assert_unique_top_level_attributes(void)
|
||||
{
|
||||
switch (0) {
|
||||
#include GENL_MAGIC_INCLUDE_FILE
|
||||
case 0:
|
||||
;
|
||||
}
|
||||
}
|
||||
@@ -218,7 +220,8 @@ static inline void ct_assert_unique_top_level_attributes(void)
|
||||
static inline void ct_assert_unique_ ## s_name ## _attributes(void) \
|
||||
{ \
|
||||
switch (0) { \
|
||||
s_fields \
|
||||
s_fields \
|
||||
case 0: \
|
||||
; \
|
||||
} \
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user