Commit 28d79b74 authored by Linus Torvalds's avatar Linus Torvalds
Browse files
Pull 9p fixes from Eric Van Hensbergen:
 "Misc set of fixes for 9p.

  Most of these clean up warnings we've gotten out of compilation tools,
  but several of them were from inspection while hunting down a couple
  of regressions.

  The most important one is 75b39682 ("fs/9p: remove unnecessary and
  overrestrictive check") which caused a regression for some folks by
  restricting mmap in any case where writeback caches weren't enabled.

  Most of the other bugs caught via inspection were type mismatches"

* tag '9p-fixes-6.5-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/ericvh/v9fs:
  fs/9p: Remove unused extern declaration
  9p: remove dead stores (variable set again without being read)
  9p: virtio: skip incrementing unused variable
  9p: virtio: make sure 'offs' is initialized in zc_request
  9p: virtio: fix unlikely null pointer deref in handle_rerror
  9p: fix ignored return value in v9fs_dir_release
  fs/9p: remove unnecessary invalidate_inode_pages2
  fs/9p: fix type mismatch in file cache mode helper
  fs/9p: fix typo in comparison logic for cache mode
  fs/9p: remove unnecessary and overrestrictive check
  fs/9p: Fix a datatype used with V9FS_DIRECT_IO
parents 818680d1 e6ab0b91
Loading
Loading
Loading
Loading
+3 −3
Original line number Diff line number Diff line
@@ -46,8 +46,8 @@ static inline struct p9_fid *v9fs_fid_clone(struct dentry *dentry)
 * NOTE: these are set after open so only reflect 9p client not
 * underlying file system on server.
 */
static inline void v9fs_fid_add_modes(struct p9_fid *fid, int s_flags,
	int s_cache, unsigned int f_flags)
static inline void v9fs_fid_add_modes(struct p9_fid *fid, unsigned int s_flags,
	unsigned int s_cache, unsigned int f_flags)
{
	if (fid->qid.type != P9_QTFILE)
		return;
@@ -57,7 +57,7 @@ static inline void v9fs_fid_add_modes(struct p9_fid *fid, int s_flags,
	   (s_flags & V9FS_DIRECT_IO) || (f_flags & O_DIRECT)) {
		fid->mode |= P9L_DIRECT; /* no read or write cache */
	} else if ((!(s_cache & CACHE_WRITEBACK)) ||
				(f_flags & O_DSYNC) | (s_flags & V9FS_SYNC)) {
				(f_flags & O_DSYNC) || (s_flags & V9FS_SYNC)) {
		fid->mode |= P9L_NOWRITECACHE;
	}
}
+0 −2
Original line number Diff line number Diff line
@@ -545,8 +545,6 @@ void v9fs_session_begin_cancel(struct v9fs_session_info *v9ses)
	p9_client_begin_disconnect(v9ses->clnt);
}

extern int v9fs_error_init(void);

static struct kobject *v9fs_kobj;

#ifdef CONFIG_9P_FSCACHE
+1 −1
Original line number Diff line number Diff line
@@ -108,7 +108,7 @@ enum p9_cache_bits {

struct v9fs_session_info {
	/* options */
	unsigned char flags;
	unsigned int flags;
	unsigned char nodev;
	unsigned short debug;
	unsigned int afid;
+3 −2
Original line number Diff line number Diff line
@@ -208,7 +208,7 @@ int v9fs_dir_release(struct inode *inode, struct file *filp)
	struct p9_fid *fid;
	__le32 version;
	loff_t i_size;
	int retval = 0;
	int retval = 0, put_err;

	fid = filp->private_data;
	p9_debug(P9_DEBUG_VFS, "inode: %p filp: %p fid: %d\n",
@@ -221,7 +221,8 @@ int v9fs_dir_release(struct inode *inode, struct file *filp)
		spin_lock(&inode->i_lock);
		hlist_del(&fid->ilist);
		spin_unlock(&inode->i_lock);
		retval = p9_fid_put(fid);
		put_err = p9_fid_put(fid);
		retval = retval < 0 ? retval : put_err;
	}

	if ((filp->f_mode & FMODE_WRITE)) {
+1 −4
Original line number Diff line number Diff line
@@ -505,10 +505,7 @@ v9fs_file_mmap(struct file *filp, struct vm_area_struct *vma)
	p9_debug(P9_DEBUG_MMAP, "filp :%p\n", filp);

	if (!(v9ses->cache & CACHE_WRITEBACK)) {
		p9_debug(P9_DEBUG_CACHE, "(no mmap mode)");
		if (vma->vm_flags & VM_MAYSHARE)
			return -ENODEV;
		invalidate_inode_pages2(filp->f_mapping);
		p9_debug(P9_DEBUG_CACHE, "(read-only mmap mode)");
		return generic_file_readonly_mmap(filp, vma);
	}

Loading