Why does not the rmdir command fail when deleting a non-empty directory from a CIFS share mounted with version higher than 1.0 in RHEL 7 ?

Solution Verified - Updated -

Issue

  • The command rmdir wrongly returns rc=0 when deleting a directory that it's not empty in a CIFS share mounted with version >1.0:
root@rhel-7.3 # cd /cifsmount/ && mkdir directorytest && touch directorytest/filetest
root@rhel-7.3 # rmdir directorytest 
root@rhel-7.3 # echo $?
0
  • It's expected that the command rmdir will return a return code different than 0 because this command cannot delete directories that are not empty.

Environment

Red Hat Enterprise Linux 7.3
kernel-3.10.0-514.el7.x86_64
CIFS shared mounted with version > 1.0

Subscriber exclusive content

A Red Hat subscription provides unlimited access to our knowledgebase of over 48,000 articles and solutions.

Current Customers and Partners

Log in for full access

Log In
Close

Welcome! Check out the Getting Started with Red Hat page for quick tours and guides for common tasks.