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 ...
Showing the changes to include/linux (3 of 23 files). Show all
Unified · Split
| @@ -499,22 +499,33 @@ static inline void blkg_get(struct blkcg_gq *blkg) · 498 unmodified lines | ||
| 499 | 499 | */ |
| 500 | 500 | static inline bool blkg_tryget(struct blkcg_gq *blkg) |
| 501 | 501 | { |
| 502 | − return percpu_ref_tryget(&blkg->refcnt); | |
| 502 | + return blkg && percpu_ref_tryget(&blkg->refcnt); | |
| 503 | 503 | } |
| 504 | 504 | |
| 505 | 505 | /** |
| 506 | 506 | * blkg_tryget_closest - try and get a blkg ref on the closet blkg |
| 507 | 507 | * @blkg: blkg to get |
| 508 | 508 | * |
| 509 | − * This walks up the blkg tree to find the closest non-dying blkg and returns | |
| 510 | − * the blkg that it did association with as it may not be the passed in blkg. | |
| 509 | + * This needs to be called rcu protected. As the failure mode here is to walk | |
| 510 | + * up the blkg tree, this ensure that the blkg->parent pointers are always | |
| 511 | + * valid. This returns the blkg that it ended up taking a reference on or %NULL | |
| 512 | + * if no reference was taken. | |
| 511 | 513 | */ |
| 512 | 514 | static inline struct blkcg_gq *blkg_tryget_closest(struct blkcg_gq *blkg) |
| 513 | 515 | { |
| 514 | − while (blkg && !percpu_ref_tryget(&blkg->refcnt)) | |
| 516 | + struct blkcg_gq *ret_blkg = NULL; | |
| 517 | + | |
| 518 | + WARN_ON_ONCE(!rcu_read_lock_held()); | |
| 519 | + | |
| 520 | + while (blkg) { | |
| 521 | + if (blkg_tryget(blkg)) { | |
| 522 | + ret_blkg = blkg; | |
| 523 | + break; | |
| 524 | + } | |
| 515 | 525 | blkg = blkg->parent; |
| 526 | + } | |
| 516 | 527 | |
| 517 | − return blkg; | |
| 528 | + return ret_blkg; | |
| 518 | 529 | } |
| 519 | 530 | |
| 520 | 531 | /** |
| @@ -51,7 +51,7 @@ · 50 unmodified lines | ||
| 51 | 51 | #endif |
| 52 | 52 | |
| 53 | 53 | extern const char *drbd_buildtag(void); |
| 54 | −#define REL_VERSION "8.4.10" | |
| 54 | +#define REL_VERSION "8.4.11" | |
| 55 | 55 | #define API_VERSION 1 |
| 56 | 56 | #define PRO_VERSION_MIN 86 |
| 57 | 57 | #define PRO_VERSION_MAX 101 |
| @@ -191,6 +191,7 @@ static inline void ct_assert_unique_operations(void) · 190 unmodified lines | ||
| 191 | 191 | { |
| 192 | 192 | switch (0) { |
| 193 | 193 | #include GENL_MAGIC_INCLUDE_FILE |
| 194 | + case 0: | |
| 194 | 195 | ; |
| 195 | 196 | } |
| 196 | 197 | } |
| @@ -209,6 +210,7 @@ static inline void ct_assert_unique_top_level_attributes(void) · 12 unmodified lines | ||
| 209 | 210 | { |
| 210 | 211 | switch (0) { |
| 211 | 212 | #include GENL_MAGIC_INCLUDE_FILE |
| 213 | + case 0: | |
| 212 | 214 | ; |
| 213 | 215 | } |
| 214 | 216 | } |
| @@ -218,7 +220,8 @@ static inline void ct_assert_unique_top_level_attributes(void) · 3 unmodified lines | ||
| 218 | 220 | static inline void ct_assert_unique_ ## s_name ## _attributes(void) \ |
| 219 | 221 | { \ |
| 220 | 222 | switch (0) { \ |
| 221 | − s_fields \ | |
| 223 | + s_fields \ | |
| 224 | + case 0: \ | |
| 222 | 225 | ; \ |
| 223 | 226 | } \ |
| 224 | 227 | } |