Re: [PATCH v4 3/3] ceph: don't NULL terminate virtual xattrs

2019-06-25 Thread Jeff Layton
On Tue, 2019-06-25 at 16:35 +0200, Ilya Dryomov wrote: > On Mon, Jun 24, 2019 at 6:27 PM Jeff Layton wrote: > > The convention with xattrs is to not store the termination with string > > data, given that it returns the length. This is how setfattr/getfattr > > operate. > > > > Most of ceph's virt

Re: [PATCH v4 3/3] ceph: don't NULL terminate virtual xattrs

2019-06-25 Thread Ilya Dryomov
On Mon, Jun 24, 2019 at 6:27 PM Jeff Layton wrote: > > The convention with xattrs is to not store the termination with string > data, given that it returns the length. This is how setfattr/getfattr > operate. > > Most of ceph's virtual xattr routines use snprintf to plop the string > directly into

Re: [PATCH v4 3/3] ceph: don't NULL terminate virtual xattrs

2019-06-25 Thread Yan, Zheng
On Tue, Jun 25, 2019 at 4:18 AM Jeff Layton wrote: > > The convention with xattrs is to not store the termination with string > data, given that it returns the length. This is how setfattr/getfattr > operate. > > Most of ceph's virtual xattr routines use snprintf to plop the string > directly into

[PATCH v4 3/3] ceph: don't NULL terminate virtual xattrs

2019-06-24 Thread Jeff Layton
The convention with xattrs is to not store the termination with string data, given that it returns the length. This is how setfattr/getfattr operate. Most of ceph's virtual xattr routines use snprintf to plop the string directly into the destination buffer, but snprintf always NULL terminates the