Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 28 May 2019 20:54:59 +0000 (UTC)
From:      Johannes Lundberg <johalun@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r348338 - head/sys/fs/pseudofs
Message-ID:  <201905282054.x4SKsxZ2083779@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: johalun
Date: Tue May 28 20:54:59 2019
New Revision: 348338
URL: https://svnweb.freebsd.org/changeset/base/348338

Log:
  pseudofs: Ignore unsupported commands in vop_setattr.
  
  Users of pseudofs (e.g. lindebugfs), should be able to receive
  input from command line via commands like "echo 1 > /path/to/file".
  Currently this fails because sh tries to truncate the file first and
  vop_setattr returns not supported error for this. This patch simply
  ignores the error and returns 0 instead.
  
  Reviewed by:	imp (mentor), asomers
  Approved by:	imp (mentor), asomers
  MFC after:	1 week
  Differential Revision: D20451

Modified:
  head/sys/fs/pseudofs/pseudofs_vnops.c

Modified: head/sys/fs/pseudofs/pseudofs_vnops.c
==============================================================================
--- head/sys/fs/pseudofs/pseudofs_vnops.c	Tue May 28 20:44:23 2019	(r348337)
+++ head/sys/fs/pseudofs/pseudofs_vnops.c	Tue May 28 20:54:59 2019	(r348338)
@@ -967,7 +967,8 @@ pfs_setattr(struct vop_setattr_args *va)
 	PFS_TRACE(("%s", pn->pn_name));
 	pfs_assert_not_owned(pn);
 
-	PFS_RETURN (EOPNOTSUPP);
+	/* Silently ignore unchangeable attributes. */
+	PFS_RETURN (0);
 }
 
 /*



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201905282054.x4SKsxZ2083779>