Whamcloud - gitweb
LU-9074 llite: Stop file creation for ro bind mnt 04/25204/12
authorNoopur Maheshwari <noopur.maheshwari@seagate.com>
Thu, 2 Feb 2017 09:09:31 +0000 (14:39 +0530)
committerOleg Drokin <oleg.drokin@intel.com>
Mon, 19 Jun 2017 16:27:49 +0000 (16:27 +0000)
commit6da95b1d20ebd32eace18f28070b446155588eff
treed3e0173c365d72209960fdaf11038be7b9deb5a0
parentca4659c9d1f010c1046b634cf5a592a620ac3935
LU-9074 llite: Stop file creation for ro bind mnt

While remounting the bind mount of lustre with read-only, vfs
sets MNT_READONLY in the mnt flags and does not make a call
to lustre. Hence, the change in mnt flags is not reflected in
lustre.

Therefore, file creation goes ahead in lookup operation of
lustre with LOOKUP_CREATE intent set and converted to IT_CREAT.

The fix is to disallow file creation by not setting IT_CREAT
intent when bind mnt pt is readonly and unsetting O_CREAT.

Added a test case to test that files are not created in ro
bind mount point. Files must be created after bind mount point
is converted from ro to rw.

Signed-off-by: Noopur Maheshwari <noopur.maheshwari@seagate.com>
Change-Id: Ic60fb18f539159715049515e264afdf51a00378e
Reviewed-on: https://review.whamcloud.com/25204
Reviewed-by: Andrew Perepechko <andrew.perepechko@seagate.com>
Reviewed-by: Lai Siyao <lai.siyao@intel.com>
Reviewed-by: Fan Yong <fan.yong@intel.com>
Tested-by: Jenkins
Tested-by: Maloo <hpdd-maloo@intel.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
lustre/llite/namei.c
lustre/tests/conf-sanity.sh