Home Home > GIT Browse
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNeilBrown <neilb@suse.com>2019-09-03 13:41:20 +1000
committerNeilBrown <neilb@suse.com>2019-09-03 13:41:20 +1000
commit3e64de251a1e901bdae1dcb2ae742fb000e6dc04 (patch)
tree26749fd43261f5466350e91bc6d4840ae9e9956f
parent5005c406c063794b876fed14d27a60683baedd38 (diff)
- Refresh
patches.suse/0001-NFS-flush-out-dirty-data-on-file-fput.patch. - Refresh patches.suse/0001-NFSv4-don-t-let-hanging-mounts-block-other-mounts.patch. - NFS: Allow multiple connections to NFSv4.0 servers (fate#322786). - Refresh patches.suse/nfs-set-acl-perm.patch. - Delete patches.suse/0001-NFSv4-handle-EINVAL-from-EXCHANGE_ID-better.patch. - Delete patches.suse/0001-SUNRPC-Allow-creation-of-RPC-clients-with-multiple-c.patch. - Delete patches.suse/0001-sunrpc-include-sup-groups-in-hash.patch. - Delete patches.suse/0002-NFS-Add-a-mount-option-to-specify-number-of-TCP-conn.patch. - Delete patches.suse/0003-NFSv4-Allow-multiple-connections-to-NFSv4.x-x-0-serv.patch. - Delete patches.suse/0004-pNFS-Allow-multiple-connections-to-the-DS.patch. - Delete patches.suse/0005-NFS-Display-the-nconnect-mount-option-if-it-is-set.patch. - Delete patches.suse/0007-SUNRPC-Mask-XIDs-to-prevent-replay-cache-collision.patch. - Delete patches.suse/NFS-optional-NFSv4_2-fix.patch. - Delete patches.suse/NFS-optional-NFSv4_2.patch. - Delete patches.suse/d-lookup-fairness.fix. - Delete patches.suse/getcwd-close-race-with-d_move-called-by-lustre.patch. - Delete patches.suse/sunrpc-cache-handle-missing-listeners-better.patch. - Delete patches.suse/vfs-use-synchronize_rcu_expedited-in-namespace_unlock.patch. suse-commit: 4685373d5b214e85e838177b5f67dc69c775daf1
-rw-r--r--fs/nfs/file.c6
-rw-r--r--fs/nfs/nfs4client.c4
-rw-r--r--fs/posix_acl.c11
3 files changed, 17 insertions, 4 deletions
diff --git a/fs/nfs/file.c b/fs/nfs/file.c
index 95dc90570786..e9e79a6dc1a1 100644
--- a/fs/nfs/file.c
+++ b/fs/nfs/file.c
@@ -82,6 +82,12 @@ nfs_file_release(struct inode *inode, struct file *filp)
{
dprintk("NFS: release(%pD2)\n", filp);
+ if (filp->f_mode & FMODE_WRITE)
+ /* Ensure dirty mmapped pages are flushed
+ * so there will be no dirty pages to
+ * prevent an unmount from completing.
+ */
+ vfs_fsync(filp, 0);
nfs_inc_stats(inode, NFSIOS_VFSRELEASE);
nfs_file_clear_open_context(filp);
return 0;
diff --git a/fs/nfs/nfs4client.c b/fs/nfs/nfs4client.c
index da6204025a2d..c0f21b58b2c3 100644
--- a/fs/nfs/nfs4client.c
+++ b/fs/nfs/nfs4client.c
@@ -505,7 +505,7 @@ static int nfs4_match_client(struct nfs_client *pos, struct nfs_client *new,
* remaining fields in "pos", especially the client
* ID and serverowner fields. Wait for CREATE_SESSION
* to finish. */
- if (pos->cl_cons_state > NFS_CS_READY) {
+ if (pos->cl_cons_state == NFS_CS_SESSION_INITING) {
refcount_inc(&pos->cl_count);
spin_unlock(&nn->nfs_client_lock);
@@ -879,7 +879,7 @@ static int nfs4_set_client(struct nfs_server *server,
};
struct nfs_client *clp;
- if (minorversion > 0 && proto == XPRT_TRANSPORT_TCP)
+ if (proto == XPRT_TRANSPORT_TCP)
cl_init.nconnect = nconnect;
if (server->flags & NFS_MOUNT_NORESVPORT)
set_bit(NFS_CS_NORESVPORT, &cl_init.init_flags);
diff --git a/fs/posix_acl.c b/fs/posix_acl.c
index 84ad1c90d535..6a4672197db8 100644
--- a/fs/posix_acl.c
+++ b/fs/posix_acl.c
@@ -22,6 +22,7 @@
#include <linux/xattr.h>
#include <linux/export.h>
#include <linux/user_namespace.h>
+#include <linux/magic.h>
static struct posix_acl **acl_by_type(struct inode *inode, int type)
{
@@ -864,8 +865,14 @@ set_posix_acl(struct inode *inode, int type, struct posix_acl *acl)
if (type == ACL_TYPE_DEFAULT && !S_ISDIR(inode->i_mode))
return acl ? -EACCES : 0;
- if (!inode_owner_or_capable(inode))
- return -EPERM;
+ /* NFS doesn't need an owner check, as the server will
+ * do that. The owner check is wrong when the server
+ * is mapping uids, such as with all_squash (which makes
+ * everyone an owner of a newly created file).
+ */
+ if (inode->i_sb->s_magic != NFS_SUPER_MAGIC)
+ if (!inode_owner_or_capable(inode))
+ return -EPERM;
if (acl) {
int ret = posix_acl_valid(inode->i_sb->s_user_ns, acl);