Bug 1318757

Summary: trash xlator : trash_unlink_mkdir_cbk() enters in an infinte loop which results segfault
Product: [Community] GlusterFS Reporter: Jiffin <jthottan>
Component: trash-xlatorAssignee: Anoop C S <anoopcs>
Status: CLOSED NEXTRELEASE QA Contact:
Severity: medium Docs Contact:
Priority: medium    
Version: mainlineCC: anoopcs, bugs, jthottan, pkarampu
Target Milestone: ---Keywords: Triaged
Target Release: ---   
Hardware: All   
OS: All   
Whiteboard:
Fixed In Version: glusterfs-3.8rc2 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
: 1319380 (view as bug list) Environment:
Last Closed: 2016-05-28 05:54:57 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 1319380    

Description Jiffin 2016-03-17 17:36:13 UTC
Description of problem:

The trash_unlink_mkdir() ends up in infinte loop due to the mkdir failure during creation of directory hierarchy for deleted file path.This will result in segfault of the brick process
  
Version-Release number of selected component (if applicable):
mainline

How reproducible:
always

Actual results:
result in crash

Expected results:
should handle it gracefully

Additional info:
Above mentioned issue is reported in
https://build.gluster.org/job/rackspace-regression-2GB-triggered/19112/consoleFull

Comment 1 Vijay Bellur 2016-03-17 17:41:50 UTC
REVIEW: http://review.gluster.org/13771 (features/trash: Handle unexpected errors during mkdir) posted (#1) for review on master by Anoop C S (anoopcs)

Comment 2 Vijay Bellur 2016-03-18 20:19:35 UTC
COMMIT: http://review.gluster.org/13771 committed in master by Jeff Darcy (jdarcy) 
------
commit 7b8e82f80942b862f30d3fb72c7eecb23fcae226
Author: Anoop C S <anoopcs>
Date:   Thu Mar 17 22:44:12 2016 +0530

    features/trash: Handle unexpected errors during mkdir
    
    When expected directory hierarchy in not present in trash directory,
    trash translator tries to create it inside the same. Any errors from
    posix other than the expected ones should be handled properly during
    an internal mkdir call and logged accordingly explaining the reason
    for not moving the file to trash directory.
    
    Change-Id: I4e19637138ea4fb92f9301be372ac19542a6aed8
    BUG: 1318757
    Signed-off-by: Anoop C S <anoopcs>
    Reviewed-on: http://review.gluster.org/13771
    Smoke: Gluster Build System <jenkins.com>
    NetBSD-regression: NetBSD Build System <jenkins.org>
    CentOS-regression: Gluster Build System <jenkins.com>
    Reviewed-by: jiffin tony Thottan <jthottan>