From 3c3a1212b802e9463b22b5941ccac5001056fde4 Mon Sep 17 00:00:00 2001 From: Thomas Goirand Date: Thu, 14 May 2020 20:14:37 +0200 Subject: [PATCH] Fix disk mount options The nobarrier option is invalid in recent kernels (>= 4.19), and having it makes the mount fail. It has no effect on kernel >= 4.10. Also, adding "nofail" to avoid failure when booting a server if there is a broken drive, which is common on a large cluster. Change-Id: Ib5262c26244363a1c47bdd562d560735ddc82a36 --- manifests/storage/mount.pp | 4 ++-- .../default-mount-options-changed-23d7969ef826f8be.yaml | 8 ++++++++ spec/defines/swift_storage_mount_spec.rb | 4 ++-- 3 files changed, 12 insertions(+), 4 deletions(-) create mode 100644 releasenotes/notes/default-mount-options-changed-23d7969ef826f8be.yaml diff --git a/manifests/storage/mount.pp b/manifests/storage/mount.pp index 2fa2fd2f..ee5f9443 100644 --- a/manifests/storage/mount.pp +++ b/manifests/storage/mount.pp @@ -31,9 +31,9 @@ define swift::storage::mount( include swift::deps if($loopback){ - $options = 'noatime,nodiratime,nobarrier,loop' + $options = 'noatime,nodiratime,nofail,loop' } else { - $options = 'noatime,nodiratime,nobarrier' + $options = 'noatime,nodiratime,nofail' } if($fstype == 'xfs'){ diff --git a/releasenotes/notes/default-mount-options-changed-23d7969ef826f8be.yaml b/releasenotes/notes/default-mount-options-changed-23d7969ef826f8be.yaml new file mode 100644 index 00000000..bd29343c --- /dev/null +++ b/releasenotes/notes/default-mount-options-changed-23d7969ef826f8be.yaml @@ -0,0 +1,8 @@ +--- +features: + - | + The nobarrier XFS mount option is removed from kernel 4.19.0 and beyond. + It has no effect on kernel 4.10.0. Therefore, it is now removed from the + default mount options. + Also, puppet-swift now adds the nofail option, so that a swift store node + finishes to boot even if an HDD mount is failed. diff --git a/spec/defines/swift_storage_mount_spec.rb b/spec/defines/swift_storage_mount_spec.rb index d3ea1d14..2cc30df2 100644 --- a/spec/defines/swift_storage_mount_spec.rb +++ b/spec/defines/swift_storage_mount_spec.rb @@ -19,7 +19,7 @@ describe 'swift::storage::mount' do :ensure => 'present', :device => '/dev/sda', :fstype => 'xfs', - :options => 'noatime,nodiratime,nobarrier,logbufs=8', + :options => 'noatime,nodiratime,nofail,logbufs=8', )} end @@ -33,7 +33,7 @@ describe 'swift::storage::mount' do it { is_expected.to contain_mount('/srv/node/dans_mount_point').with( :device => '/dev/sda', - :options => 'noatime,nodiratime,nobarrier,loop,logbufs=8' + :options => 'noatime,nodiratime,nofail,loop,logbufs=8' )} end