Re: [PATCH RFC] ext3 data=guarded v5

From: Andreas Dilger
Date: Wed Apr 29 2009 - 15:48:29 EST


On Apr 29, 2009 10:43 -0400, Chris Mason wrote:
> On Wed, 2009-04-29 at 10:08 -0400, Chris Mason wrote:
> > This would mean IO completion (clearing PG_writeback) would have to wait
> > on the inode mutex, which we can't quite do in O_SYNC and O_DIRECT.
> > But, what I can do is check i_nlink after the ext3_orphan_del call and
> > put the inode back on the orphan list if it has gone to zero.
>
> Ugh, that won't work, we'll just race with link and risk an orphan that
> never gets removed. I'll make a version of ext3_orphan_del that expects
> the super lock held and use that instead.

I looks like ext3_link() checks for i_nlink == 0 and returns -ENOENT to
avoid this race.

Cheers, Andreas
--
Andreas Dilger
Sr. Staff Engineer, Lustre Group
Sun Microsystems of Canada, Inc.

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/