Whamcloud - gitweb
LU-10926 llite: avoid panic in ll_set_acl() 45/32045/2
authorJames Simmons <uja.ornl@yahoo.com>
Wed, 18 Apr 2018 14:28:48 +0000 (10:28 -0400)
committerOleg Drokin <oleg.drokin@intel.com>
Wed, 2 May 2018 02:21:08 +0000 (02:21 +0000)
commit81af3db1998c2c4cca1af8f463c986257fefca4f
treefd9ee9e69bac8e3e0d5782742555aba07309b822
parent68add0d98d2299a73ee846d141fa78c146a4e206
LU-10926 llite: avoid panic in ll_set_acl()

While pushing the xattr work upstream Dan Carpenter noticed a bug
in ll_set_acl() that could panic a node. The problem is in the
case of default the code jumps to out: which calls the function
forget_cached_acl(). If you call forget_cached_acl() with a type
not related to ACLs it will crash the node via a BUG(). To avoid
this just test rc after the switch block and return since neither
the acl or xattr have been modified.

Change-Id: Ib6f3e5e818635c56cc4abbf37e7c63e6897a72a6
Signed-off-by: James Simmons <uja.ornl@yahoo.com>
Reviewed-on: https://review.whamcloud.com/32045
Tested-by: Jenkins
Tested-by: Maloo <hpdd-maloo@intel.com>
Reviewed-by: Andreas Dilger <andreas.dilger@intel.com>
Reviewed-by: Dmitry Eremin <dmitry.eremin@intel.com>
lustre/llite/file.c