linux-btrfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Sweet Tea Dorminy <sweettea-kernel@dorminy.me>
To: dsterba@suse.cz, Qu Wenruo <quwenruo.btrfs@gmx.com>,
	Qu Wenruo <wqu@suse.com>,
	linux-btrfs@vger.kernel.org,
	Johannes Thumshirn <johannes.thumshirn@wdc.com>
Subject: Re: [PATCH v2 4/4] btrfs: dump all space infos if we abort transaction due to ENOSPC
Date: Tue, 26 Jul 2022 14:38:43 -0400	[thread overview]
Message-ID: <df4a3d08-cc63-6b15-9e14-d8228f1bf873@dorminy.me> (raw)
In-Reply-To: <20220726182050.GK13489@twin.jikos.cz>



On 7/26/22 14:20, David Sterba wrote:
> On Wed, Jul 20, 2022 at 09:03:33AM +0800, Qu Wenruo wrote:
>>>> @@ -346,12 +346,14 @@ void __cold btrfs_err_32bit_limit(struct
>>>> btrfs_fs_info *fs_info)
>>>>    __cold
>>>>    void __btrfs_abort_transaction(struct btrfs_trans_handle *trans,
>>>>                       const char *function,
>>>> -                   unsigned int line, int errno)
>>>> +                   unsigned int line, int errno, bool first_hit)
>>>>    {
>>>>        struct btrfs_fs_info *fs_info = trans->fs_info;
>>>>        WRITE_ONCE(trans->aborted, errno);
>>>>        WRITE_ONCE(trans->transaction->aborted, errno);
>>>> +    if (first_hit && errno == -ENOSPC)
>>>> +        btrfs_dump_fs_space_info(fs_info);
>>>>        /* Wake up anybody who may be waiting on this transaction */
>>>>        wake_up(&fs_info->transaction_wait);
>>>>        wake_up(&fs_info->transaction_blocked_wait);
>>> DO_ONCE_LITE(btrfs_dump_fs_space_info, fs_info) from <linux/once_lite.h>
>>> seems like a more lightweight way to dump the space infos once upon
>>> first transaction abort. Then you don't have to plumb through the
>>> 'first_hit' parameter from btrfs_abort_transaction(), and this change
>>> becomes even more minimal than it already is.
>>
>> Sounds pretty awesome!
> 
> But DO_ONCE_LITE stores the status in one static variable, this cant' be
> used because we want to track the status per filesystem, and also per
> mount. Ie. repeated ENOSPC after umount/mount cycle won't be reported,
> also another filesystem hitting abort due to ENOSPC.

That's a great point, I agree it would be better to print the first 
abort per filesystem/mount instead of only once per reboot now that it's 
noted.

  reply	other threads:[~2022-07-26 18:38 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-07-19  5:11 [PATCH v2 0/4] btrfs: output more info for -ENOSPC caused transaction abort and other enhancement Qu Wenruo
2022-07-19  5:11 ` [PATCH v2 1/4] btrfs: output human readable space info flag Qu Wenruo
2022-07-19 20:38   ` Sweet Tea Dorminy
2022-07-19  5:11 ` [PATCH v2 2/4] btrfs: make __btrfs_dump_space_info() output better formatted Qu Wenruo
2022-07-19 20:56   ` Sweet Tea Dorminy
2022-07-19 21:38     ` David Sterba
2022-07-19 22:58       ` Qu Wenruo
2022-07-26 18:13         ` David Sterba
2022-07-26 20:53           ` Boris Burkov
2022-07-26 21:39             ` David Sterba
2022-07-26 23:21               ` Boris Burkov
2022-07-27  1:21                 ` Sweet Tea Dorminy
2022-07-27  1:44                   ` Qu Wenruo
2022-07-27 15:09                     ` Sweet Tea Dorminy
2022-07-19  5:11 ` [PATCH v2 3/4] btrfs: make DUMP_BLOCK_RSV() to have better output Qu Wenruo
2022-07-19  5:11 ` [PATCH v2 4/4] btrfs: dump all space infos if we abort transaction due to ENOSPC Qu Wenruo
2022-07-20  0:42   ` Sweet Tea Dorminy
2022-07-20  1:03     ` Qu Wenruo
2022-07-20  1:43       ` Sweet Tea Dorminy
2022-07-20  1:57         ` Qu Wenruo
2022-07-26 18:20       ` David Sterba
2022-07-26 18:38         ` Sweet Tea Dorminy [this message]
2022-08-24 15:53 ` [PATCH v2 0/4] btrfs: output more info for -ENOSPC caused transaction abort and other enhancement David Sterba
2022-08-25  3:04   ` Qu Wenruo

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=df4a3d08-cc63-6b15-9e14-d8228f1bf873@dorminy.me \
    --to=sweettea-kernel@dorminy.me \
    --cc=dsterba@suse.cz \
    --cc=johannes.thumshirn@wdc.com \
    --cc=linux-btrfs@vger.kernel.org \
    --cc=quwenruo.btrfs@gmx.com \
    --cc=wqu@suse.com \
    /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).