Date: Sun, 23 Apr 2017 22:56:40 +0000 From: Rick Macklem <rmacklem@uoguelph.ca> To: "freebsd-fs@freebsd.org" <freebsd-fs@freebsd.org> Subject: optionally enable the NFSv4 server to allow write opens for reading Message-ID: <YTXPR01MB01897D428DD829C7A9DEC284DD1C0@YTXPR01MB0189.CANPRD01.PROD.OUTLOOK.COM>
next in thread | raw e-mail | index | archive | help
--_002_YTXPR01MB01897D428DD829C7A9DEC284DD1C0YTXPR01MB0189CANP_ Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable When a client such as the FreeBSD one does a write of a partial block, it w= ill first read the block in. If the file is opened Write only over NFSv4, the client = can try using this open for the Read. If the server (such as the FreeBSD one in hea= d, etc) doesn't allow this, it can reply with NFSERR_OPENMODE and the client must f= ind another way to do the Read, such as using what are called a "special statei= d". The attached patch modifies the FreeBSD NFSv4 server to allow use of a Writ= e Open for Read operations (this is allowed by the RFCs). Does this sound reasonable to others to do? rick ps: You can review/test the patch, but I am mainly wondering if doing this = seems like a good idea to others?= --_002_YTXPR01MB01897D428DD829C7A9DEC284DD1C0YTXPR01MB0189CANP_ Content-Type: application/octet-stream; name="writeopenforread.patch" Content-Description: writeopenforread.patch Content-Disposition: attachment; filename="writeopenforread.patch"; size=1055; creation-date="Sun, 23 Apr 2017 22:56:35 GMT"; modification-date="Sun, 23 Apr 2017 22:56:35 GMT" Content-Transfer-Encoding: base64 LS0tIGZzL25mc3NlcnZlci9uZnNfbmZzZHN0YXRlLmMub3JpZwkyMDE3LTA0LTE1IDEwOjU4OjM4 LjA0MzM5MDAwMCAtMDQwMAorKysgZnMvbmZzc2VydmVyL25mc19uZnNkc3RhdGUuYwkyMDE3LTA0 LTIzIDA5OjU5OjMwLjY3ODU5MjAwMCAtMDQwMApAQCAtNzUsNiArNzUsMTEgQEAgU1lTQ1RMX0lO VChfdmZzX25mc2QsIE9JRF9BVVRPLCB3cml0ZWRlbAogICAgICZuZnNydl93cml0ZWRlbGVnaWZw b3MsI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VEVBQ0NFU1MpKSkgewo= --_002_YTXPR01MB01897D428DD829C7A9DEC284DD1C0YTXPR01MB0189CANP_--
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?YTXPR01MB01897D428DD829C7A9DEC284DD1C0>