From patchwork Mon Nov 25 11:00:05 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anand Jain X-Patchwork-Id: 3229531 Return-Path: X-Original-To: patchwork-linux-btrfs@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 0AB839F3AE for ; Mon, 25 Nov 2013 10:51:06 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 3BFB720212 for ; Mon, 25 Nov 2013 10:51:01 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 15EB320127 for ; Mon, 25 Nov 2013 10:51:00 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751793Ab3KYKu5 (ORCPT ); Mon, 25 Nov 2013 05:50:57 -0500 Received: from aserp1040.oracle.com ([141.146.126.69]:29949 "EHLO aserp1040.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750867Ab3KYKu4 (ORCPT ); Mon, 25 Nov 2013 05:50:56 -0500 Received: from ucsinet21.oracle.com (ucsinet21.oracle.com [156.151.31.93]) by aserp1040.oracle.com (Sentrion-MTA-4.3.1/Sentrion-MTA-4.3.1) with ESMTP id rAPAotnX003318 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Mon, 25 Nov 2013 10:50:56 GMT Received: from aserz7022.oracle.com (aserz7022.oracle.com [141.146.126.231]) by ucsinet21.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id rAPAosuZ015309 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Mon, 25 Nov 2013 10:50:55 GMT Received: from abhmp0001.oracle.com (abhmp0001.oracle.com [141.146.116.7]) by aserz7022.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id rAPAosqs027876 for ; Mon, 25 Nov 2013 10:50:54 GMT Received: from wish.sg.oracle.com (/10.186.101.18) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Mon, 25 Nov 2013 02:50:53 -0800 From: Anand Jain To: linux-btrfs@vger.kernel.org Subject: [PATCH v2] btrfs: scrub maintenance event should be recorded in the messages Date: Mon, 25 Nov 2013 19:00:05 +0800 Message-Id: <1385377205-9461-1-git-send-email-anand.jain@oracle.com> X-Mailer: git-send-email 1.8.1.164.g2d0029e In-Reply-To: <1385374689-3745-1-git-send-email-anand.jain@oracle.com> References: <1385374689-3745-1-git-send-email-anand.jain@oracle.com> X-Source-IP: ucsinet21.oracle.com [156.151.31.93] Sender: linux-btrfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-btrfs@vger.kernel.org X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP so to help problem understanding and solving Signed-off-by: Anand Jain --- v2: log shoud be starting instead of started fs/btrfs/ioctl.c | 10 ++++++++++ 1 files changed, 10 insertions(+), 0 deletions(-) diff --git a/fs/btrfs/ioctl.c b/fs/btrfs/ioctl.c index d237af8..84801b9 100644 --- a/fs/btrfs/ioctl.c +++ b/fs/btrfs/ioctl.c @@ -3593,10 +3593,20 @@ static long btrfs_ioctl_scrub(struct file *file, void __user *arg) goto out; } + printk(KERN_INFO "btrfs: Scrub starting on %pU devid %llu\n", + root->fs_info->fsid, sa->devid); + ret = btrfs_scrub_dev(root->fs_info, sa->devid, sa->start, sa->end, &sa->progress, sa->flags & BTRFS_SCRUB_READONLY, 0); + if (ret) + printk(KERN_INFO "btrfs: Scrub failed on %pU devid %llu\n", + root->fs_info->fsid, sa->devid); + else + printk(KERN_INFO "btrfs: Scrub finished on %pU devid %llu\n", + root->fs_info->fsid, sa->devid); + if (copy_to_user(arg, sa, sizeof(*sa))) ret = -EFAULT;