From: Satoru Takeuchi <takeuchi_satoru@jp.fujitsu.com>
To: Anand Jain <Anand.Jain@oracle.com>, <linux-btrfs@vger.kernel.org>
Cc: <dsterba@suse.cz>
Subject: Re: [PATCH 2/2 v2] btrfs: device delete must be sysloged
Date: Wed, 2 Jul 2014 16:03:28 +0900 [thread overview]
Message-ID: <53B3AEC0.4060407@jp.fujitsu.com> (raw)
In-Reply-To: <1404265052-29424-2-git-send-email-Anand.Jain@oracle.com>
(2014/07/02 10:37), Anand Jain wrote:
> as in the disk add patch, disk detached from the volume must be
> recorded in the syslog as well for the same reason.
>
> Signed-off-by: Anand Jain <Anand.Jain@oracle.com>
> Reviewed-by: David Sterba <dsterba@suse.cz>
Reviewed-by: Satoru Takeuchi <takeuchi_satoru@jp.fujitsu.com>
Tested-by: Satoru Takeuchi <takeuchi_satoru@jp.fujitsu.com>
test result:
3.16-rc3: failed
3.16-rc3 with these patches: success
===============================================================================
#!/bin/sh
TEST_DEV1=/dev/vdb
TEST_DEV2=/dev/vdc
TEST_MNT=/home/sat/mnt
umount $TEST_MNT
mkfs.btrfs -f $TEST_DEV1
dmesg >dmesg.old
mount $TEST_DEV1 $TEST_MNT
btrfs dev add -f $TEST_DEV2 $TEST_MNT
if [ $? -ne 0 ] ; then
echo "[ERROR] failed to btrfs dev add." >&2
exit 1
fi
btrfs dev del $TEST_DEV2 $TEST_MNT
if [ $? -ne 0 ] ; then
echo "[ERROR] failed to btrfs dev delete" >&2
exit 1
fi
dmesg >dmesg.new
diff dmesg.old dmesg.new | grep '^>' >dmesg.diff
RET=0
TEST_DEV1_BASE=$(basename $TEST_DEV1)
if grep -q "BTRFS info (device $TEST_DEV1_BASE): device added $TEST_DEV2" dmesg.diff ; then
echo "[PASS] btrfs device add is logged." >&2
else
echo "[FAIL] btrfs device add is not logged." >&2
RET=1
fi
if grep -q "BTRFS info (device $TEST_DEV1_BASE): device deleted $TEST_DEV2" dmesg.diff ; then
echo "[PASS] btrfs device delete is logged." >&2
else
echo "[FAIL] btrfs device delete is not logged." >&2
RET=1
fi
rm dmesg.{new,old,diff}
umount $TEST_MNT
exit $RET
===============================================================================
Thanks,
Satoru
> ---
> v2: Accepts David's review comments, thanks
>
> fs/btrfs/ioctl.c | 4 ++++
> 1 file changed, 4 insertions(+)
>
> diff --git a/fs/btrfs/ioctl.c b/fs/btrfs/ioctl.c
> index 4e10259..016a5eb 100644
> --- a/fs/btrfs/ioctl.c
> +++ b/fs/btrfs/ioctl.c
> @@ -2531,6 +2531,10 @@ static long btrfs_ioctl_rm_dev(struct file *file, void __user *arg)
> mutex_unlock(&root->fs_info->volume_mutex);
> atomic_set(&root->fs_info->mutually_exclusive_operation_running, 0);
>
> + if (!ret)
> + btrfs_info(root->fs_info, "device deleted %s",
> + vol_args->name);
> +
> out:
> kfree(vol_args);
> mnt_drop_write_file(file);
>
next prev parent reply other threads:[~2014-07-02 7:03 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-06-30 16:58 [PATCH 1/2] btrfs: device add must be sysloged Anand Jain
2014-06-30 16:58 ` [PATCH 2/2] btrfs: device delete " Anand Jain
2014-07-01 17:49 ` David Sterba
2014-07-01 17:46 ` [PATCH 1/2] btrfs: device add " David Sterba
2014-07-02 1:39 ` Anand Jain
2014-07-02 1:37 ` [PATCH 1/2 v2] " Anand Jain
2014-07-02 1:37 ` [PATCH 2/2 v2] btrfs: device delete " Anand Jain
2014-07-02 7:03 ` Satoru Takeuchi [this message]
2014-07-02 7:02 ` [PATCH 1/2 v2] btrfs: device add " Satoru Takeuchi
2014-07-02 7:06 ` Satoru Takeuchi
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=53B3AEC0.4060407@jp.fujitsu.com \
--to=takeuchi_satoru@jp.fujitsu.com \
--cc=Anand.Jain@oracle.com \
--cc=dsterba@suse.cz \
--cc=linux-btrfs@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).