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

Re: [Xen-devel] [GIT PULL] xen: xenfs fixes for 4.9-rc2



On Mon, Oct 24, 2016 at 9:37 AM, David Vrabel <dvrabel@xxxxxxxxxx> wrote:
>
> I think the changes are trivial and uncontroversial.

Hmm. Sadly, they are also buggy.

This:

                if (files->mode & S_IFLNK) {

is simply wrong. The correct test for S_IFLNK is to do

                if ((files->mode & S_IFMT) == S_IFLNK) {

and quite frankly, the right model is almost certainly to just do a
switch-statement that does something like

                switch (files->mode & S_IFMT) {
                case S_IFLNK:
                        ...
                case S_IFREG:
                case 0:
                        ....
                default:
                        ..error..

because maybe somebody wants to add other cases later (and even if
not, it's just wrong to randomly change any other mode into S_IFREG).

And while I could easily do an evil merge and fix that part up, I
really don't want to do things like that. So I'm not going to pull
this.

               Linus

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
https://lists.xen.org/xen-devel

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.