Re: [patch] tmpfs: incr. link-count on directory rename

From: Uli Martens (u.martens@scientific.de)
Date: Thu Feb 14 2002 - 04:34:01 EST


On Thu, 2002-02-14 at 07:19, Jan Harkes wrote:
>
> ps. shouldn't the linkcount of the old_dir get decremented too? Also you
> should only change the linkcounts when the operation completed
> successfully. i.e. something more like,
Oops, you're right, the linkcount of old_dir isn't decremented at the
moment, too. I will test your patch this evening, but I think it looks
better than mine... ;)

> --- /tmp/shmem.c.orig Thu Feb 14 01:17:23 2002
> +++ /tmp/shmem.c Thu Feb 14 01:18:25 2002
> @@ -1100,6 +1100,10 @@
> error = 0;
> old_dentry->d_inode->i_ctime = old_dir->i_ctime = old_dir->i_mtime = CURRENT_TIME;
> }
> + if (!error && S_ISDIR(old_dentry->d_inode->i_mode)) {
> + old_dir->i_nlink--;
> + new_dir->i_nlink++;
> + }
> return error;
> }

-- 
uli martens

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



This archive was generated by hypermail 2b29 : Fri Feb 15 2002 - 21:01:00 EST