File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -400,12 +400,19 @@ int blk_validate_limits(struct queue_limits *lim)
400400 lim -> max_discard_sectors =
401401 min (lim -> max_hw_discard_sectors , lim -> max_user_discard_sectors );
402402
403+ /*
404+ * When discard is not supported, discard_granularity should be reported
405+ * as 0 to userspace.
406+ */
407+ if (lim -> max_discard_sectors )
408+ lim -> discard_granularity =
409+ max (lim -> discard_granularity , lim -> physical_block_size );
410+ else
411+ lim -> discard_granularity = 0 ;
412+
403413 if (!lim -> max_discard_segments )
404414 lim -> max_discard_segments = 1 ;
405415
406- if (lim -> discard_granularity < lim -> physical_block_size )
407- lim -> discard_granularity = lim -> physical_block_size ;
408-
409416 /*
410417 * By default there is no limit on the segment boundary alignment,
411418 * but if there is one it can't be smaller than the page size as
Original file line number Diff line number Diff line change @@ -700,6 +700,8 @@ static void zloop_free_disk(struct gendisk *disk)
700700 struct zloop_device * zlo = disk -> private_data ;
701701 unsigned int i ;
702702
703+ blk_mq_free_tag_set (& zlo -> tag_set );
704+
703705 for (i = 0 ; i < zlo -> nr_zones ; i ++ ) {
704706 struct zloop_zone * zone = & zlo -> zones [i ];
705707
@@ -1080,7 +1082,6 @@ static int zloop_ctl_remove(struct zloop_options *opts)
10801082
10811083 del_gendisk (zlo -> disk );
10821084 put_disk (zlo -> disk );
1083- blk_mq_free_tag_set (& zlo -> tag_set );
10841085
10851086 pr_info ("Removed device %d\n" , opts -> id );
10861087
Original file line number Diff line number Diff line change @@ -60,7 +60,8 @@ static inline int __get_task_ioprio(struct task_struct *p)
6060 int prio ;
6161
6262 if (!ioc )
63- return IOPRIO_DEFAULT ;
63+ return IOPRIO_PRIO_VALUE (task_nice_ioclass (p ),
64+ task_nice_ioprio (p ));
6465
6566 if (p != current )
6667 lockdep_assert_held (& p -> alloc_lock );
You can’t perform that action at this time.
0 commit comments