Re: [PATCH 2/3] xfs: don't ever put nlink > 0 inodes on the unlinked list

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

 



On Wed, Feb 13, 2019 at 12:50:53PM -0800, Darrick J. Wong wrote:
> +	if (tmpfile) {
> +		/*
> +		 * The VFS requires that any inode fed to d_tmpfile must have
> +		 * nlink == 1 so that it can decrement the nlink in d_tmpfile.
> +		 * However, we created the temp file with nlink == 0 because
> +		 * we're not allowed to put an inode with nlink > 0 on the
> +		 * unlinked list.  Therefore we have to set nlink to 1 so that
> +		 * d_tmpfile can immediately set it back to zero.
> +		 */
> +		set_nlink(inode, 1);
>  		d_tmpfile(dentry, inode);
> +	} else

At least btrtfs has to work around these d_tmpfile assumptions as well.
Instead of piling hacks over hacks I'd rather move the call to
inode_dec_link_count from d_tmpfile, which should lead to a saner
interface.



[Index of Archives]     [XFS Filesystem Development (older mail)]     [Linux Filesystem Development]     [Linux Audio Users]     [Yosemite Trails]     [Linux Kernel]     [Linux RAID]     [Linux SCSI]


  Powered by Linux