Re: [PATCH RFC] Btrfs: fix deadlock between sys_sync and freeze

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Il 14/08/2012 15:53, Liu Bo ha scritto:
On 08/14/2012 08:59 PM, Marco Stornelli wrote:
Il 14/08/2012 07:01, liub.liubo@xxxxxxxxx ha scritto:
From: Liu Bo <bo.li.liu@xxxxxxxxxx>

I found this while testing xfstests 068, the story is

      t1                                            t2
    sys_sync                                    thaw_super
      iterate_supers
        down_read(sb->s_umount)                   down_write(sb->s_umount) --->wait for t1
        sync_fs (with wait mode)
          start_transaction
            sb_start_intwrite --------------------> wait for t2 to set s_writers.frozen to SB_UNFROZEN

In this patch, I add an helper sb_start_intwrite_trylock() and use it before we
start_transaction in sync_fs() with wait mode so that we won't hit the deadlock.


IMHO, we should avoid to call the sync operation on a frozen fs. The freeze operation, indeed, already include a sync operation.
According to man page, no other operation should modify the fs after the freeze.
So for me the modification is inside sync_filesystem (and sync_one_sb).

Do you mean that we should add the trylock check in sync_filesystem?

But it seems to be useless because we already run into down_read(sb->s_umount) before starting sync_one_sb().

thanks,
liubo


I meant that we should check if there are in a "complete" freeze state (according to the "states" of a freeze transaction) and simply skip the sync operation.

Marco
--
To unsubscribe from this list: send the line "unsubscribe linux-fsdevel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Ext4 Filesystem]     [Union Filesystem]     [Filesystem Testing]     [Ceph Users]     [Ecryptfs]     [AutoFS]     [Kernel Newbies]     [Share Photos]     [Security]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux Cachefs]     [Reiser Filesystem]     [Linux RAID]     [Samba]     [Device Mapper]     [CEPH Development]
  Powered by Linux