Re: [PATCH 03/28] unlink: monitor i_nlink

From: Christoph Hellwig
Date: Thu Aug 03 2006 - 10:33:32 EST

On Tue, Aug 01, 2006 at 04:52:42PM -0700, Dave Hansen wrote:
> When a filesystem decrements i_nlink to zero, it means that a
> write must be performed in order to drop the inode from the
> filesystem.
> We're shortly going to have keep filesystems from being remounted
> r/o between the time that this i_nlink decrement and that write
> occurs.
> So, add a little helper function to do the decrements. We'll
> tie into it in a bit to note when i_nlink hits zero.

Looks good. I wonder if we could find a better name for it. Maybe just
dec_nlink? And add a simple counterpart

static inline void inc_nlink(struct inode *inode)

for symmetry reasons. After that the patch can go off to Andrew before
the series aswell.

> Should
> we also be checking all of the places where i_nlink is explicitly
> set to 0 in the unlink paths?

They'll definitly need some auditing.
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at
Please read the FAQ at