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 <jeffm@suse.com>
Signed-off-by: James Simmons <uja.ornl@gmail.com>
Change-Id: I2a71d0515f3735f8eb3e94d190e68e41a36e0f68
Reviewed-on: http://review.whamcloud.com/10375
Tested-by: Jenkins
Tested-by: Maloo <hpdd-maloo@intel.com>
Reviewed-by: Yang Sheng <yang.sheng@intel.com>
Reviewed-by: Bob Glossman <bob.glossman@intel.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
* 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))