Merge tag 'for-4.19/post-20180822' of git://git.kernel.dk/linux-block
[sfrench/cifs-2.6.git] / kernel / trace / blktrace.c
index b951aa1fac6177cbed5e7a8d19de6a938bc2c241..2868d85f1fb1d3286984c4727f0519957ac069a9 100644 (file)
@@ -1,19 +1,7 @@
+// SPDX-License-Identifier: GPL-2.0
 /*
  * Copyright (C) 2006 Jens Axboe <axboe@kernel.dk>
  *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License version 2 as
- * published by the Free Software Foundation.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
- *
  */
 #include <linux/kernel.h>
 #include <linux/blkdev.h>
@@ -1841,6 +1829,10 @@ static ssize_t sysfs_blk_trace_attr_store(struct device *dev,
        mutex_lock(&q->blk_trace_mutex);
 
        if (attr == &dev_attr_enable) {
+               if (!!value == !!q->blk_trace) {
+                       ret = 0;
+                       goto out_unlock_bdev;
+               }
                if (value)
                        ret = blk_trace_setup_queue(q, bdev);
                else