Unverified Commit 4abe797a authored by openeuler-ci-bot's avatar openeuler-ci-bot Committed by Gitee
Browse files
parents ec820b43 6263aad5
Loading
Loading
Loading
Loading
+2 −1
Original line number Original line Diff line number Diff line
@@ -1095,7 +1095,8 @@ int nfs_open(struct inode *inode, struct file *filp)
{
{
	struct nfs_open_context *ctx;
	struct nfs_open_context *ctx;


	ctx = alloc_nfs_open_context(file_dentry(filp), filp->f_mode, filp);
	ctx = alloc_nfs_open_context(file_dentry(filp),
				     flags_to_mode(filp->f_flags), filp);
	if (IS_ERR(ctx))
	if (IS_ERR(ctx))
		return PTR_ERR(ctx);
		return PTR_ERR(ctx);
	nfs_file_set_open_context(filp, ctx);
	nfs_file_set_open_context(filp, ctx);
+2 −6
Original line number Original line Diff line number Diff line
@@ -30,7 +30,6 @@ nfs4_file_open(struct inode *inode, struct file *filp)
	struct dentry *parent = NULL;
	struct dentry *parent = NULL;
	struct inode *dir;
	struct inode *dir;
	unsigned openflags = filp->f_flags;
	unsigned openflags = filp->f_flags;
	fmode_t f_mode;
	struct iattr attr;
	struct iattr attr;
	int err;
	int err;


@@ -49,17 +48,14 @@ nfs4_file_open(struct inode *inode, struct file *filp)
	if (err)
	if (err)
		return err;
		return err;


	f_mode = filp->f_mode;
	if ((openflags & O_ACCMODE) == 3)
		f_mode |= flags_to_mode(openflags);

	/* We can't create new files here */
	/* We can't create new files here */
	openflags &= ~(O_CREAT|O_EXCL);
	openflags &= ~(O_CREAT|O_EXCL);


	parent = dget_parent(dentry);
	parent = dget_parent(dentry);
	dir = d_inode(parent);
	dir = d_inode(parent);


	ctx = alloc_nfs_open_context(file_dentry(filp), f_mode, filp);
	ctx = alloc_nfs_open_context(file_dentry(filp),
				     flags_to_mode(openflags), filp);
	err = PTR_ERR(ctx);
	err = PTR_ERR(ctx);
	if (IS_ERR(ctx))
	if (IS_ERR(ctx))
		goto out;
		goto out;