From: Jeff Mahoney Date: Fri, 6 Jun 2014 19:52:58 +0000 (-0400) Subject: LU-4416 osd-ldiskfs: set I_LINKABLE for inc_nlink X-Git-Tag: 2.6.0-RC1~84 X-Git-Url: https://git.whamcloud.com/?p=fs%2Flustre-release.git;a=commitdiff_plain;h=9245e456e7d38222034626bc26e7de2f95657ee0 LU-4416 osd-ldiskfs: set I_LINKABLE for inc_nlink Linux commit f4e0c30c191 (allow the temp files created by open() to be linked to) put in a check to warn if I_LINKABLE was not set when trying to pull nlinks up from 0. This patch sets the flag to properly allow it. Signed-off-by: Jeff Mahoney Signed-off-by: James Simmons Change-Id: I2a71d0515f3735f8eb3e94d190e68e41a36e0f68 Reviewed-on: http://review.whamcloud.com/10375 Tested-by: Jenkins Tested-by: Maloo Reviewed-by: Yang Sheng Reviewed-by: Bob Glossman Reviewed-by: Oleg Drokin --- diff --git a/lustre/osd-ldiskfs/osd_handler.c b/lustre/osd-ldiskfs/osd_handler.c index cf6bccc..430bb60 100644 --- a/lustre/osd-ldiskfs/osd_handler.c +++ b/lustre/osd-ldiskfs/osd_handler.c @@ -2802,6 +2802,13 @@ static int osd_object_ref_add(const struct lu_env *env, * This also has to properly handle the case of inodes with nlink == 0 * in case they are being linked into the PENDING directory */ +#ifdef I_LINKABLE + /* This is necessary to increment from i_nlink == 0 */ + spin_lock(&inode->i_lock); + inode->i_state |= I_LINKABLE; + spin_unlock(&inode->i_lock); +#endif + spin_lock(&obj->oo_guard); ldiskfs_inc_count(oh->ot_handle, inode); if (!S_ISDIR(inode->i_mode))