History

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 ...

Linus Torvalds committed 7 years ago

Commit 77d0b192 parents b79f9f9 427c5ce23 files · +467 −131Browse files

Showing the changes to include/linux (3 of 23 files). Show all

Unified · Split

3 files
  1. include/linux/blk-cgroup.h +16 −5
  2. include/linux/drbd.h +1 −1
  3. include/linux/genl_magic_struct.h +4 −1
include/linux/blk-cgroup.h+16−5
@@ -499,22 +499,33 @@ static inline void blkg_get(struct blkcg_gq *blkg) · 498 unmodified lines
499499 */
500500 static inline bool blkg_tryget(struct blkcg_gq *blkg)
501501 {
502− return percpu_ref_tryget(&blkg->refcnt);
502+ return blkg && percpu_ref_tryget(&blkg->refcnt);
503503 }
504504
505505 /**
506506 * blkg_tryget_closest - try and get a blkg ref on the closet blkg
507507 * @blkg: blkg to get
508508 *
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.
511513 */
512514 static inline struct blkcg_gq *blkg_tryget_closest(struct blkcg_gq *blkg)
513515 {
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+ }
515525 blkg = blkg->parent;
526+ }
516527
517− return blkg;
528+ return ret_blkg;
518529 }
519530
520531 /**
include/linux/drbd.h+1−1
@@ -51,7 +51,7 @@ · 50 unmodified lines
5151 #endif
5252
5353 extern const char *drbd_buildtag(void);
54−#define REL_VERSION "8.4.10"
54+#define REL_VERSION "8.4.11"
5555 #define API_VERSION 1
5656 #define PRO_VERSION_MIN 86
5757 #define PRO_VERSION_MAX 101
include/linux/genl_magic_struct.h+4−1
@@ -191,6 +191,7 @@ static inline void ct_assert_unique_operations(void) · 190 unmodified lines
191191 {
192192 switch (0) {
193193 #include GENL_MAGIC_INCLUDE_FILE
194+ case 0:
194195 ;
195196 }
196197 }
@@ -209,6 +210,7 @@ static inline void ct_assert_unique_top_level_attributes(void) · 12 unmodified lines
209210 {
210211 switch (0) {
211212 #include GENL_MAGIC_INCLUDE_FILE
213+ case 0:
212214 ;
213215 }
214216 }
@@ -218,7 +220,8 @@ static inline void ct_assert_unique_top_level_attributes(void) · 3 unmodified lines
218220 static inline void ct_assert_unique_ ## s_name ## _attributes(void) \
219221 { \
220222 switch (0) { \
221− s_fields \
223+ s_fields \
224+ case 0: \
222225 ; \
223226 } \
224227 }