|
@@ -1664,7 +1664,7 @@ static int udf_update_inode(struct inode *inode, int do_sync)
|
|
FE_PERM_U_DELETE | FE_PERM_U_CHATTR));
|
|
FE_PERM_U_DELETE | FE_PERM_U_CHATTR));
|
|
fe->permissions = cpu_to_le32(udfperms);
|
|
fe->permissions = cpu_to_le32(udfperms);
|
|
|
|
|
|
- if (S_ISDIR(inode->i_mode))
|
|
|
|
|
|
+ if (S_ISDIR(inode->i_mode) && inode->i_nlink > 0)
|
|
fe->fileLinkCount = cpu_to_le16(inode->i_nlink - 1);
|
|
fe->fileLinkCount = cpu_to_le16(inode->i_nlink - 1);
|
|
else
|
|
else
|
|
fe->fileLinkCount = cpu_to_le16(inode->i_nlink);
|
|
fe->fileLinkCount = cpu_to_le16(inode->i_nlink);
|