Re: [PATCH 2/2] Btrfs: fix deadlock on sb->s_umount when doing umount

2011-12-07 Thread Miao Xie
On Wed, 7 Dec 2011 13:11:58 +0200, Ilya Dryomov wrote: > On Wed, Dec 07, 2011 at 10:31:35AM +0800, Miao Xie wrote: >> On tue, 6 Dec 2011 16:36:11 -0500, Chris Mason wrote: >>> On Tue, Dec 06, 2011 at 06:23:23AM -0500, Christoph Hellwig wrote: On Tue, Dec 06, 2011 at 07:06:40PM +0800, Miao Xie

Re: [PATCH 2/2] Btrfs: fix deadlock on sb->s_umount when doing umount

2011-12-07 Thread Ilya Dryomov
On Wed, Dec 07, 2011 at 10:31:35AM +0800, Miao Xie wrote: > On tue, 6 Dec 2011 16:36:11 -0500, Chris Mason wrote: > > On Tue, Dec 06, 2011 at 06:23:23AM -0500, Christoph Hellwig wrote: > >> On Tue, Dec 06, 2011 at 07:06:40PM +0800, Miao Xie wrote: > I can't see why you need the writeout when t

Re: [PATCH 2/2] Btrfs: fix deadlock on sb->s_umount when doing umount

2011-12-06 Thread Miao Xie
On tue, 6 Dec 2011 16:36:11 -0500, Chris Mason wrote: > On Tue, Dec 06, 2011 at 06:23:23AM -0500, Christoph Hellwig wrote: >> On Tue, Dec 06, 2011 at 07:06:40PM +0800, Miao Xie wrote: I can't see why you need the writeout when the trylocks fails. Umount needs to take care of writing out

Re: [PATCH 2/2] Btrfs: fix deadlock on sb->s_umount when doing umount

2011-12-06 Thread Chris Mason
On Tue, Dec 06, 2011 at 06:23:23AM -0500, Christoph Hellwig wrote: > On Tue, Dec 06, 2011 at 07:06:40PM +0800, Miao Xie wrote: > > > I can't see why you need the writeout when the trylocks fails. Umount > > > needs to take care of writing out all pending file data anyway, so doing > > > it from th

Re: [PATCH 2/2] Btrfs: fix deadlock on sb->s_umount when doing umount

2011-12-06 Thread Christoph Hellwig
On Tue, Dec 06, 2011 at 07:06:40PM +0800, Miao Xie wrote: > > I can't see why you need the writeout when the trylocks fails. Umount > > needs to take care of writing out all pending file data anyway, so doing > > it from the cleaner thread in addition doesn't sound like it would help. > > umount

Re: [PATCH 2/2] Btrfs: fix deadlock on sb->s_umount when doing umount

2011-12-06 Thread Miao Xie
On tue, 6 Dec 2011 04:59:23 -0500, Christoph Hellwig wrote: > On Tue, Dec 06, 2011 at 01:35:47PM +0800, Miao Xie wrote: >> The reason the deadlock is that: >> Task Btrfs-cleaner >> umount() >> down_write(&s->s_umount) >> close_ctree() >> wait

Re: [PATCH 2/2] Btrfs: fix deadlock on sb->s_umount when doing umount

2011-12-06 Thread Christoph Hellwig
On Tue, Dec 06, 2011 at 01:35:47PM +0800, Miao Xie wrote: > The reason the deadlock is that: > TaskBtrfs-cleaner > umount() > down_write(&s->s_umount) > close_ctree() > wait for the end of > btrfs-cleaner >

Re: [PATCH 2/2] Btrfs: fix deadlock on sb->s_umount when doing umount

2011-12-05 Thread Miao Xie
On tue, 6 Dec 2011 05:49:06 +, Al Viro wrote: > >> +void btrfs_writeback_inodes_sb_nr(struct btrfs_root *root, >> + unsigned long nr_pages) >> +{ >> +struct super_block *sb = root->fs_info->sb; >> + >> +if (writeback_in_progress(sb->s_bdi)) >> +

Re: [PATCH 2/2] Btrfs: fix deadlock on sb->s_umount when doing umount

2011-12-05 Thread Al Viro
> +void btrfs_writeback_inodes_sb_nr(struct btrfs_root *root, > + unsigned long nr_pages) > +{ > + struct super_block *sb = root->fs_info->sb; > + > + if (writeback_in_progress(sb->s_bdi)) > + return; > + > + /* > + * If we can not get s_u

[PATCH 2/2] Btrfs: fix deadlock on sb->s_umount when doing umount

2011-12-05 Thread Miao Xie
The reason the deadlock is that: Task Btrfs-cleaner umount() down_write(&s->s_umount) close_ctree() wait for the end of btrfs-cleaner start_transaction reserve