Whamcloud - gitweb
LU-4185 llite: Revise create with no open optimization
Currently ll_lookup_nd just returns a negative when we are trying
to create something with no open (read mkdir). This is all fine most
of the cases, except if the directory where we are trying to do is
not writeable by us. In that case vfs_create would return EPERM
seeing as how a negative dentry means the create cannot proceed.
But in reality if there is an existing name there that we just did
not have cached, the proper return is EEXIST that could only happen
if we did do the lookup.
So amend the optimization to only take place if the directory is
writeable by us, otherwise do the full lookup.
Signed-off-by: Oleg Drokin <oleg.drokin@intel.com>
Signed-off-by: Bobi Jam <bobijam.xu@intel.com>
Change-Id: I1480320bd56431a2e47ae686450678324ca17633
Reviewed-on: http://review.whamcloud.com/8257
Tested-by: Maloo <hpdd-maloo@intel.com>
Reviewed-by: Fan Yong <fan.yong@intel.com>
Reviewed-by: Niu Yawei <yawei.niu@intel.com>