Unverified Commit 55b4fcdf authored by Steve French's avatar Steve French Committed by GitHub
Browse files

Merge pull request #52 from namjaejeon/cifsd-for-next

cifsd-fixes
parents 10a96b2b 2ae1a6cc
Loading
Loading
Loading
Loading
+8 −7
Original line number Diff line number Diff line
@@ -182,7 +182,8 @@ struct posix_acl_state {
int parse_sec_desc(struct smb_ntsd *pntsd, int acl_len,
		   struct smb_fattr *fattr);
int build_sec_desc(struct smb_ntsd *pntsd, struct smb_ntsd *ppntsd,
		int addition_info, __u32 *secdesclen, struct smb_fattr *fattr);
		   int addition_info, __u32 *secdesclen,
		   struct smb_fattr *fattr);
int init_acl_state(struct posix_acl_state *state, int cnt);
void free_acl_state(struct posix_acl_state *state);
void posix_state_to_acl(struct posix_acl_state *state,
+18 −10
Original line number Diff line number Diff line
@@ -274,7 +274,6 @@ static int ksmbd_vfs_stream_read(struct ksmbd_file *fp, char *buf, loff_t *pos,
{
	ssize_t v_len;
	char *stream_buf = NULL;
	int err;

	ksmbd_debug(VFS, "read stream data pos : %llu, count : %zd\n",
		    *pos, count);
@@ -283,14 +282,22 @@ static int ksmbd_vfs_stream_read(struct ksmbd_file *fp, char *buf, loff_t *pos,
				       fp->stream.name,
				       fp->stream.size,
				       &stream_buf);
	if (v_len == -ENOENT) {
		ksmbd_err("not found stream in xattr : %zd\n", v_len);
		err = -ENOENT;
		return err;
	if ((int)v_len <= 0)
		return (int)v_len;

	if (v_len <= *pos) {
		count = -EINVAL;
		goto free_buf;
	}

	if (v_len - *pos < count)
		count = v_len - *pos;

	memcpy(buf, &stream_buf[*pos], count);
	return v_len > count ? count : v_len;

free_buf:
	kvfree(stream_buf);
	return count;
}

/**
@@ -414,9 +421,9 @@ static int ksmbd_vfs_stream_write(struct ksmbd_file *fp, char *buf, loff_t *pos,
				       fp->stream.name,
				       fp->stream.size,
				       &stream_buf);
	if (v_len == -ENOENT) {
	if ((int)v_len < 0) {
		ksmbd_err("not found stream in xattr : %zd\n", v_len);
		err = -ENOENT;
		err = (int)v_len;
		goto out;
	}

@@ -429,6 +436,7 @@ static int ksmbd_vfs_stream_write(struct ksmbd_file *fp, char *buf, loff_t *pos,

		if (v_len > 0)
			memcpy(wbuf, stream_buf, v_len);
		kvfree(stream_buf);
		stream_buf = wbuf;
	}

@@ -934,8 +942,8 @@ ssize_t ksmbd_vfs_getxattr(struct dentry *dentry, char *xattr_name,
	if (!buf)
		return -ENOMEM;

	xattr_len = vfs_getxattr(&init_user_ns, dentry, xattr_name, (void *)buf,
			xattr_len);
	xattr_len = vfs_getxattr(&init_user_ns, dentry, xattr_name,
				 (void *)buf, xattr_len);
	if (xattr_len > 0)
		*xattr_buf = buf;
	else
+8 −8
Original line number Diff line number Diff line
@@ -25,14 +25,14 @@
#define KSMBD_NO_FID		(UINT_MAX)
#define SMB2_NO_FID		(0xFFFFFFFFFFFFFFFFULL)

#define FP_FILENAME(fp)		fp->filp->f_path.dentry->d_name.name
#define FP_INODE(fp)		d_inode(fp->filp->f_path.dentry)
#define PARENT_INODE(fp)	d_inode(fp->filp->f_path.dentry->d_parent)

#define ATTR_FP(fp) (fp->attrib_only && \
		(fp->cdoption != FILE_OVERWRITE_IF_LE && \
		fp->cdoption != FILE_OVERWRITE_LE && \
		fp->cdoption != FILE_SUPERSEDE_LE))
#define FP_FILENAME(fp)		((fp)->filp->f_path.dentry->d_name.name)
#define FP_INODE(fp)		d_inode((fp)->filp->f_path.dentry)
#define PARENT_INODE(fp)	d_inode((fp)->filp->f_path.dentry->d_parent)

#define ATTR_FP(fp) ((fp)->attrib_only && \
		     ((fp)->cdoption != FILE_OVERWRITE_IF_LE && \
		      (fp)->cdoption != FILE_OVERWRITE_LE && \
		      (fp)->cdoption != FILE_SUPERSEDE_LE))

struct ksmbd_conn;
struct ksmbd_session;
+1 −1

File changed.

Contains only whitespace changes.

+2 −2

File changed.

Contains only whitespace changes.

+3 −3

File changed.

Contains only whitespace changes.

+4 −4

File changed.

Contains only whitespace changes.

+1 −1

File changed.

Contains only whitespace changes.

Loading