From: David Sterba <dsterba@suse.cz>
To: Nikolay Borisov <nborisov@suse.com>
Cc: linux-btrfs@vger.kernel.org
Subject: Re: [PATCH 3/7] btrfs: Use ihold instead of igrab in cow_file_range_async
Date: Fri, 4 Jan 2019 16:29:18 +0100 [thread overview]
Message-ID: <20190104152918.GP23615@twin.jikos.cz> (raw)
In-Reply-To: <20190103085005.32053-4-nborisov@suse.com>
On Thu, Jan 03, 2019 at 10:50:01AM +0200, Nikolay Borisov wrote:
> ihold is supposed to be used when the caller already has a reference to
> the inode. In the case of cow_file_range_async this invariants holds,
> since the 3 call chains leading to this function all take a reference:
>
> btrfs_writepage <--- does igrab
> extent_write_full_page
> __extent_writepage
> writepage_delalloc
> btrfs_run_delalloc_range
> cow_file_range_async
>
> extent_write_cache_pages <--- does igrab
> __extent_writepage (same callchain as above)
>
> and
>
> submit_compressed_extents <-- already called from async CoW submit path,
> which would have done ihold.
> extent_write_locked_range
> __extent_writepage
So by the logic the inode reference needs to be taken early, eg. in
btrfs_writepage and all low-level callbacks or helpers are fine with
ihold.
Reviewed-by: David Sterba <dsterba@suse.com>
next prev parent reply other threads:[~2019-01-04 15:29 UTC|newest]
Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-01-03 8:49 [PATCH 0/7] More misc fixes Nikolay Borisov
2019-01-03 8:49 ` [PATCH 1/7] btrfs: Remove inode argument from async_cow_submit Nikolay Borisov
2019-01-05 6:02 ` Anand Jain
2019-01-07 10:12 ` Johannes Thumshirn
2019-01-03 8:50 ` [PATCH 2/7] btrfs: Remove isize local variable in compress_file_range Nikolay Borisov
2019-01-05 6:17 ` Anand Jain
2019-01-07 10:17 ` Johannes Thumshirn
2019-01-07 17:41 ` David Sterba
2019-01-03 8:50 ` [PATCH 3/7] btrfs: Use ihold instead of igrab in cow_file_range_async Nikolay Borisov
2019-01-04 15:29 ` David Sterba [this message]
2019-01-03 8:50 ` [PATCH 4/7] btrfs: Remove WARN_ON in btrfs_alloc_delalloc_work Nikolay Borisov
2019-01-04 15:30 ` David Sterba
2019-01-07 10:19 ` Johannes Thumshirn
2019-01-03 8:50 ` [PATCH 5/7] btrfs: Document logic in async_cow_submit Nikolay Borisov
2019-01-03 8:50 ` [PATCH 6/7] btrfs: Replace open-coded maths with DIV_ROUND_UP Nikolay Borisov
2019-01-03 14:44 ` David Sterba
2019-01-03 15:33 ` Nikolay Borisov
2019-01-07 15:29 ` David Sterba
2019-01-03 8:50 ` [PATCH 7/7] btrfs: Refactor shrink_delalloc Nikolay Borisov
2019-01-04 15:35 ` David Sterba
2019-01-07 17:58 ` David Sterba
2019-01-07 17:59 ` [PATCH 0/7] More misc fixes David Sterba
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=20190104152918.GP23615@twin.jikos.cz \
--to=dsterba@suse.cz \
--cc=linux-btrfs@vger.kernel.org \
--cc=nborisov@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.