Message ID | 20180516025128.9899-4-anand.jain@oracle.com (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
On 16.05.2018 05:51, Anand Jain wrote: > Add a kernel log when the balance ends, either for cancel or completed > or if it is paused. Reviewed-by: Nikolay Borisov <nborisov@suse.com> > --- > v1->v2: Moved from 2/3 to 3/3 > > fs/btrfs/volumes.c | 7 +++++++ > 1 file changed, 7 insertions(+) > > diff --git a/fs/btrfs/volumes.c b/fs/btrfs/volumes.c > index ce68c4f42f94..a4e243a29f5c 100644 > --- a/fs/btrfs/volumes.c > +++ b/fs/btrfs/volumes.c > @@ -4053,6 +4053,13 @@ int btrfs_balance(struct btrfs_fs_info *fs_info, > ret = __btrfs_balance(fs_info); > > mutex_lock(&fs_info->balance_mutex); > + if (ret == -ECANCELED && atomic_read(&fs_info->balance_pause_req)) > + btrfs_info(fs_info, "balance: paused"); > + else if (ret == -ECANCELED && atomic_read(&fs_info->balance_cancel_req)) > + btrfs_info(fs_info, "balance: canceled"); > + else > + btrfs_info(fs_info, "balance: ended with status: %d", ret); > + > clear_bit(BTRFS_FS_BALANCE_RUNNING, &fs_info->flags); > > if (bargs) { > -- To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
On 2018-05-15 22:51, Anand Jain wrote: > Add a kernel log when the balance ends, either for cancel or completed > or if it is paused. > --- > v1->v2: Moved from 2/3 to 3/3 > > fs/btrfs/volumes.c | 7 +++++++ > 1 file changed, 7 insertions(+) > > diff --git a/fs/btrfs/volumes.c b/fs/btrfs/volumes.c > index ce68c4f42f94..a4e243a29f5c 100644 > --- a/fs/btrfs/volumes.c > +++ b/fs/btrfs/volumes.c > @@ -4053,6 +4053,13 @@ int btrfs_balance(struct btrfs_fs_info *fs_info, > ret = __btrfs_balance(fs_info); > > mutex_lock(&fs_info->balance_mutex); > + if (ret == -ECANCELED && atomic_read(&fs_info->balance_pause_req)) > + btrfs_info(fs_info, "balance: paused"); > + else if (ret == -ECANCELED && atomic_read(&fs_info->balance_cancel_req)) > + btrfs_info(fs_info, "balance: canceled"); > + else > + btrfs_info(fs_info, "balance: ended with status: %d", ret); > + > clear_bit(BTRFS_FS_BALANCE_RUNNING, &fs_info->flags); > > if (bargs) { > Is there some way that these messages could be extended to include info about which volume the balance in question was on. Ideally, something that matches up with what's listed in the message from the previous patch. There's nothi9ng that prevents you from running balances on separate BTRFS volumes in parallel, so this message won't necessarily be for the most recent balance start message. -- To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
On 05/16/2018 07:25 PM, Austin S. Hemmelgarn wrote: > On 2018-05-15 22:51, Anand Jain wrote: >> Add a kernel log when the balance ends, either for cancel or completed >> or if it is paused. >> --- >> v1->v2: Moved from 2/3 to 3/3 >> >> fs/btrfs/volumes.c | 7 +++++++ >> 1 file changed, 7 insertions(+) >> >> diff --git a/fs/btrfs/volumes.c b/fs/btrfs/volumes.c >> index ce68c4f42f94..a4e243a29f5c 100644 >> --- a/fs/btrfs/volumes.c >> +++ b/fs/btrfs/volumes.c >> @@ -4053,6 +4053,13 @@ int btrfs_balance(struct btrfs_fs_info *fs_info, >> ret = __btrfs_balance(fs_info); >> mutex_lock(&fs_info->balance_mutex); >> + if (ret == -ECANCELED && atomic_read(&fs_info->balance_pause_req)) >> + btrfs_info(fs_info, "balance: paused"); >> + else if (ret == -ECANCELED && >> atomic_read(&fs_info->balance_cancel_req)) >> + btrfs_info(fs_info, "balance: canceled"); >> + else >> + btrfs_info(fs_info, "balance: ended with status: %d", ret); >> + >> clear_bit(BTRFS_FS_BALANCE_RUNNING, &fs_info->flags); >> if (bargs) { >> > Is there some way that these messages could be extended to include info > about which volume the balance in question was on. Ideally, something > that matches up with what's listed in the message from the previous > patch. There's nothi9ng that prevents you from running balances on > separate BTRFS volumes in parallel, so this message won't necessarily be > for the most recent balance start message. Hm. That's not true, btrfs_info(fs_info,,) adds the fsid. So its already drilled down to the lowest granular possible. Thanks. Anand > -- > To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in > the body of a message to majordomo@vger.kernel.org > More majordomo info at http://vger.kernel.org/majordomo-info.html -- To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
On 2018-05-16 09:23, Anand Jain wrote: > > > On 05/16/2018 07:25 PM, Austin S. Hemmelgarn wrote: >> On 2018-05-15 22:51, Anand Jain wrote: >>> Add a kernel log when the balance ends, either for cancel or completed >>> or if it is paused. >>> --- >>> v1->v2: Moved from 2/3 to 3/3 >>> >>> fs/btrfs/volumes.c | 7 +++++++ >>> 1 file changed, 7 insertions(+) >>> >>> diff --git a/fs/btrfs/volumes.c b/fs/btrfs/volumes.c >>> index ce68c4f42f94..a4e243a29f5c 100644 >>> --- a/fs/btrfs/volumes.c >>> +++ b/fs/btrfs/volumes.c >>> @@ -4053,6 +4053,13 @@ int btrfs_balance(struct btrfs_fs_info *fs_info, >>> ret = __btrfs_balance(fs_info); >>> mutex_lock(&fs_info->balance_mutex); >>> + if (ret == -ECANCELED && atomic_read(&fs_info->balance_pause_req)) >>> + btrfs_info(fs_info, "balance: paused"); >>> + else if (ret == -ECANCELED && >>> atomic_read(&fs_info->balance_cancel_req)) >>> + btrfs_info(fs_info, "balance: canceled"); >>> + else >>> + btrfs_info(fs_info, "balance: ended with status: %d", ret); >>> + >>> clear_bit(BTRFS_FS_BALANCE_RUNNING, &fs_info->flags); >>> if (bargs) { >>> >> Is there some way that these messages could be extended to include >> info about which volume the balance in question was on. Ideally, >> something that matches up with what's listed in the message from the >> previous patch. There's nothi9ng that prevents you from running >> balances on separate BTRFS volumes in parallel, so this message won't >> necessarily be for the most recent balance start message. > > Hm. That's not true, btrfs_info(fs_info,,) adds the fsid. > So its already drilled down to the lowest granular possible. > Ah, you're right, it does. Sorry about the noise. -- To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
On Wed, May 16, 2018 at 10:51:28AM +0800, Anand Jain wrote: > Add a kernel log when the balance ends, either for cancel or completed > or if it is paused. Missing S-O-B. > --- > v1->v2: Moved from 2/3 to 3/3 > > fs/btrfs/volumes.c | 7 +++++++ > 1 file changed, 7 insertions(+) > > diff --git a/fs/btrfs/volumes.c b/fs/btrfs/volumes.c > index ce68c4f42f94..a4e243a29f5c 100644 > --- a/fs/btrfs/volumes.c > +++ b/fs/btrfs/volumes.c > @@ -4053,6 +4053,13 @@ int btrfs_balance(struct btrfs_fs_info *fs_info, > ret = __btrfs_balance(fs_info); > > mutex_lock(&fs_info->balance_mutex); > + if (ret == -ECANCELED && atomic_read(&fs_info->balance_pause_req)) > + btrfs_info(fs_info, "balance: paused"); > + else if (ret == -ECANCELED && atomic_read(&fs_info->balance_cancel_req)) > + btrfs_info(fs_info, "balance: canceled"); > + else > + btrfs_info(fs_info, "balance: ended with status: %d", ret); Wouldn't that repeat the same once again? There are status messages printed already, when eg. balance is cancelled or paused. -- To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
On 05/17/2018 08:06 PM, David Sterba wrote: > On Wed, May 16, 2018 at 10:51:28AM +0800, Anand Jain wrote: >> Add a kernel log when the balance ends, either for cancel or completed >> or if it is paused. > > Missing S-O-B. oops. Fixed in v3. >> --- >> v1->v2: Moved from 2/3 to 3/3 >> >> fs/btrfs/volumes.c | 7 +++++++ >> 1 file changed, 7 insertions(+) >> >> diff --git a/fs/btrfs/volumes.c b/fs/btrfs/volumes.c >> index ce68c4f42f94..a4e243a29f5c 100644 >> --- a/fs/btrfs/volumes.c >> +++ b/fs/btrfs/volumes.c >> @@ -4053,6 +4053,13 @@ int btrfs_balance(struct btrfs_fs_info *fs_info, >> ret = __btrfs_balance(fs_info); >> >> mutex_lock(&fs_info->balance_mutex); >> + if (ret == -ECANCELED && atomic_read(&fs_info->balance_pause_req)) >> + btrfs_info(fs_info, "balance: paused"); >> + else if (ret == -ECANCELED && atomic_read(&fs_info->balance_cancel_req)) >> + btrfs_info(fs_info, "balance: canceled"); >> + else >> + btrfs_info(fs_info, "balance: ended with status: %d", ret); > > Wouldn't that repeat the same once again? There are status messages > printed already, when eg. balance is cancelled or paused. No it won't. They are under if - else if- else. The __btrfs_balance() returns ECANCELED for both paused and canceled so bifurcating them here is useful. Thanks, Anand > -- > To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in > the body of a message to majordomo@vger.kernel.org > More majordomo info at http://vger.kernel.org/majordomo-info.html > -- To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
diff --git a/fs/btrfs/volumes.c b/fs/btrfs/volumes.c index ce68c4f42f94..a4e243a29f5c 100644 --- a/fs/btrfs/volumes.c +++ b/fs/btrfs/volumes.c @@ -4053,6 +4053,13 @@ int btrfs_balance(struct btrfs_fs_info *fs_info, ret = __btrfs_balance(fs_info); mutex_lock(&fs_info->balance_mutex); + if (ret == -ECANCELED && atomic_read(&fs_info->balance_pause_req)) + btrfs_info(fs_info, "balance: paused"); + else if (ret == -ECANCELED && atomic_read(&fs_info->balance_cancel_req)) + btrfs_info(fs_info, "balance: canceled"); + else + btrfs_info(fs_info, "balance: ended with status: %d", ret); + clear_bit(BTRFS_FS_BALANCE_RUNNING, &fs_info->flags); if (bargs) {