Re: [PATCH 3/4] samples/vfs: check whether flag was raised

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thu, Jan 30, 2025 at 09:45:50AM +0100, Miklos Szeredi wrote:
> On Thu, 30 Jan 2025 at 00:20, Christian Brauner <brauner@xxxxxxxxxx> wrote:
> >
> > For string options the kernel will raise the corresponding flag only if
> > the string isn't empty. So check for the flag.
> 
> Hmm, seems like this is going to be a common mistake.

Probably.

> 
> How about just putting a nul char at sm->str, which will solve this
> once and for all (any unset str_ offset will point to this empty
> string)?

Agreed.

> 
> Then we can say that instead of checking the mask for a string it's
> okay to rely on it being empty by default.

Right, but I do prefer checking whether the flag is raised or not. But
we can just support both.




[Index of Archives]     [Linux Ext4 Filesystem]     [Union Filesystem]     [Filesystem Testing]     [Ceph Users]     [Ecryptfs]     [NTFS 3]     [AutoFS]     [Kernel Newbies]     [Share Photos]     [Security]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux Cachefs]     [Reiser Filesystem]     [Linux RAID]     [NTFS 3]     [Samba]     [Device Mapper]     [CEPH Development]

  Powered by Linux