lkml.org 
[lkml]   [2017]   [Oct]   [10]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH] btrfs: use appropriate replacements for __sb_{start,end}_write calls
From
Date


On 10.10.2017 13:48, Rakesh Pandit wrote:
> Commit a53f4f8e9c8eb ("btrfs: Don't call btrfs_start_transaction() on
> frozen fs to avoid deadlock.") started using internal calls and we
> replace them with more suitable ones.
>
> Signed-off-by: Rakesh Pandit <rakesh@tuxera.com>
> ---
> fs/btrfs/super.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/fs/btrfs/super.c b/fs/btrfs/super.c
> index 35a128a..99c21ae 100644
> --- a/fs/btrfs/super.c
> +++ b/fs/btrfs/super.c
> @@ -1205,8 +1205,8 @@ int btrfs_sync_fs(struct super_block *sb, int wait)
> * happens. The pending operations are delayed to the
> * next commit after thawing.
> */
> - if (__sb_start_write(sb, SB_FREEZE_WRITE, false))
> - __sb_end_write(sb, SB_FREEZE_WRITE);
> + if (sb_start_write_trylock(sb))
> + sb_end_write(sb)
> else
> return 0;

On second thought, what's to prevent the filesystem to be frozen if
sb_start_write/sb_end_write code executes? Or even after we are in the
middle of btrfs_start_transaction?


> trans = btrfs_start_transaction(root, 0);
>

\
 
 \ /
  Last update: 2017-10-10 13:10    [W:0.115 / U:0.308 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site