Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 15 Feb 2015 21:50:09 +0000 (UTC)
From:      Dmitry Chagin <dchagin@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-user@freebsd.org
Subject:   svn commit: r278821 - user/dchagin/lemul/sys/fs/pseudofs
Message-ID:  <201502152150.t1FLo9km075976@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: dchagin
Date: Sun Feb 15 21:50:08 2015
New Revision: 278821
URL: https://svnweb.freebsd.org/changeset/base/278821

Log:
  To allow reading pseudofs files by chunks replace sbuf from fixed to autoextend.
  The problem appears when the user tries to read a small chunk of the pseudofs
  file. The underlying fill method will fail if the size of the supplied sbuf sb
  is less than required to contain method data.

Modified:
  user/dchagin/lemul/sys/fs/pseudofs/pseudofs_vnops.c

Modified: user/dchagin/lemul/sys/fs/pseudofs/pseudofs_vnops.c
==============================================================================
--- user/dchagin/lemul/sys/fs/pseudofs/pseudofs_vnops.c	Sun Feb 15 21:47:43 2015	(r278820)
+++ user/dchagin/lemul/sys/fs/pseudofs/pseudofs_vnops.c	Sun Feb 15 21:50:08 2015	(r278821)
@@ -662,7 +662,7 @@ pfs_read(struct vop_read_args *va)
 	if (buflen > MAXPHYS)
 		buflen = MAXPHYS;
 
-	sb = sbuf_new(sb, NULL, buflen + 1, 0);
+	sb = sbuf_new_auto();
 	if (sb == NULL) {
 		error = EIO;
 		goto ret;



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