Register a SA Forums Account here!
JOINING THE SA FORUMS WILL REMOVE THIS BIG AD, THE ANNOYING UNDERLINED ADS, AND STUPID INTERSTITIAL ADS!!!

You can: log in, read the tech support FAQ, or request your lost password. This dumb message (and those ads) will appear on every screen until you register! Get rid of this crap by registering your own SA Forums Account and joining roughly 150,000 Goons, for the one-time price of $9.95! We charge money because it costs us money per month for bills, and since we don't believe in showing ads to our users, we try to make the money back through forum registrations.
 
  • Post
  • Reply
fletcher
Jun 27, 2003

ken park is my favorite movie

Cybernetic Crumb

necrotic posted:

I had forgotten how utterly horrible PHP is.

I don't understand where those 3 examples you quoted would come into play in the real world at all

Adbot
ADBOT LOVES YOU

Nippashish
Nov 2, 2005

Let me see you dance!
Somebody tell me who it was that decided to make every variable in lua global by default. I want to find him and kill him.

Look Around You
Jan 19, 2009

Nippashish posted:

Somebody tell me who it was that decided to make every variable in lua global by default. I want to find him and kill him.

IIRC their rationale was that it's easier to go with mutating an existing variable default (i.e. global by default) and force declarations for introducing new variables at that scope, rather than needing global and nonlocal and getting other associated scoping issues from introducing new variables by default (local as default) in python and ruby. Which is especially if you want to have true lexical scoping; you need a clean way to say "I want to assign to this variable an a higher scope", and differentiate between the true global scope or just a higher, but non global scope if you have local by default, where as if you do global by default, you just always indicate when you need a new variable. It sucks to read when people don't use local, but the semantics are a lot simpler, and more familiar; it's what's used in Javascript, C{,++,#}, Java, and so on (though C family languages require variable declaration while javascript and lua just do an implicit global).

Look Around You fucked around with this message at 10:21 on Jul 26, 2014

Deus Rex
Mar 5, 2005

fletcher posted:

I don't understand where those 3 examples you quoted would come into play in the real world at all

strcmp returns 0 if its arguments are equal or NULL if at least one of its arguments is not a string (edit: only sometimes! I think it's only if the value doesn't 'naturally' coerce to a string, for example numbers and NULL as arguments do not cause strcmp to return NULL).

Guess what can happen if you do if (strcmp($_GET["whatever"], "some string") == 0)! Hint: the parameters in $_GET are not always strings!

(by the way, this behavior is not at all documented! http://php.net/manual/en/function.strcmp.php)

Deus Rex fucked around with this message at 10:30 on Jul 26, 2014

Look Around You
Jan 19, 2009

Deus Rex posted:

strcmp returns 0 if its arguments are equal or NULL if at least one of its arguments is not a string (edit: only sometimes! I think it's only if the value doesn't 'naturally' coerce to a string, for example numbers and NULL as arguments do not cause strcmp to return NULL).

Guess what can happen if you do if (strcmp($_GET["whatever"], "some string") == 0)! Hint: the parameters in $_GET are not always strings!

(by the way, this behavior is not at all documented! http://php.net/manual/en/function.strcmp.php)

Lmfao at the guy in the comments suggesting md5-hashing strings to make sure they're equal. And then someone replying to him cautioning about hash collisions (instead of pointing out how absurd it is to use a hash function to test for routine string equality).

Qwertycoatl
Dec 31, 2008

Look Around You posted:

Lmfao at the guy in the comments suggesting md5-hashing strings to make sure they're equal. And then someone replying to him cautioning about hash collisions (instead of pointing out how absurd it is to use a hash function to test for routine string equality).

That guy's comment is amazing.

quote:

Sometimes when you compare two strings that look "the same", you will find that they aren't. If you don't want to bother finding out why, then this is a simple solution:

$string = implode(str_split($string));

Converting the strings to md5 is also a nice method to see if they're equal.

md5($str1)."\n";
md5($str2)."\n\n";

Skimming the documentation, it looks like that "$string = implode(str_split($string));" just gets back to the original string. Is it just the commenter being dumb or does that code do something for some :psyduck: reason?

Qwertycoatl fucked around with this message at 10:47 on Jul 26, 2014

Carthag Tuek
Oct 15, 2005

Tider skal komme,
tider skal henrulle,
slægt skal følge slægters gang



Qwertycoatl posted:

Skimming the documentation, it looks like that "$string = implode(str_split($string));" just gets back to the original string. Is it just the commenter being dumb or does that code do something for some :psyduck: reason?

I think it's like a hosed up way to coerce to string. So if $string is a number (or array, etc), it'll become a string of that number (array etc) instead.

canis minor
May 4, 2011

Look Around You posted:

IIRC their rationale was that it's easier to go with mutating an existing variable default (i.e. global by default) and force declarations for introducing new variables at that scope, rather than needing global and nonlocal and getting other associated scoping issues from introducing new variables by default (local as default) in python and ruby. Which is especially if you want to have true lexical scoping; you need a clean way to say "I want to assign to this variable an a higher scope", and differentiate between the true global scope or just a higher, but non global scope if you have local by default, where as if you do global by default, you just always indicate when you need a new variable. It sucks to read when people don't use local, but the semantics are a lot simpler, and more familiar; it's what's used in Javascript, C{,++,#}, Java, and so on (though C family languages require variable declaration while javascript and lua just do an implicit global).

As JS goes things get... tricky in edge cases. Consider this:

code:
<a href="#" onclick="name = 5; f = 6">click</a>
What will be the value of window.name and window.f?

name is a property of window and while it is overridable, in this case it won't be; name will be assigned as a property of A (as - document.getElementsByTagName("A")[0].name will be 5 and it will be a string; don't worry - window.f will also be a string, because lol), f will be assigned as a property of window

While this example is silly, once this amounted for a couple hours of debugging on why are events not properly bound to objects (as event names are affected by this as well).

And adding an additional JS horror, this:

code:
var name = 8;
var f = 8;
What will be the type of name and f?

var name = 8 is the same as writing window.name = 8 and window.name has immutable type.

Here's a fiddle: http://jsbin.com/nofopuro/1/

I think scopes could have been done better in JS.

edit: edited per comment below - my mistake, I'm dumb

canis minor fucked around with this message at 15:22 on Jul 26, 2014

Subjunctive
Sep 12, 2006

✨sparkle and shine✨

eithedog posted:

As JS goes things get... tricky in edge cases. Consider this:

code:
<a href="#" onclick="name = 5; f = 6">click</a>
window.f will also be a string, because lol

The name behaviour is due to the way DOM events are defined in terms of JS scopes, not because of how JS scopes themselves work. DOM0 is indeed a mess, but using event listeners or out-of-markup functions makes that particular weirdness go away (window.f is a number, by the way.)

quote:

While this example is silly, once this amounted for a couple hours of debugging on why are events not properly bound to objects (as event names are affected by this as well).

Can you give an example for the event name case? I'm trying to think of one that has this clash.

quote:

var name = 8 is the same as writing this.name = 8, which in global scope this = window; and window.name has immutable type

I think scopes could have been done better in JS.

var name = 8 and this.name = 8 don't have the same meaning in JS. Ignoring that variable declaration and property assignment have somewhat different semantics, this is not usually the variables object. It's very easy to see by putting the code in a function.

JS scopes are pretty reasonable (though the lack of implicit this-binding for closures is annoying). DOM0's weirdness runs pretty deep; DOM1+ less so.

OddObserver
Apr 3, 2009
In fact the one thing 'this' can't be is a local variable scope.
(It could be some weird magic scopes like the scope of exception variable in ES3, but that insanity
got fixed in ES5)

canis minor
May 4, 2011

Subjunctive posted:

The name behaviour is due to the way DOM events are defined in terms of JS scopes, not because of how JS scopes themselves work. DOM0 is indeed a mess, but using event listeners or out-of-markup functions makes that particular weirdness go away (window.f is a number, by the way.)

I thought I've tested that and typeof window.f gave me string, but getting back at it you're indeed correct (I was suprised when I've gotten string, but attributed it to parsing of attribute). I agree - separating JS and assigning listeners via

code:
document.getElementById('whatever').onclick = function(){};


removes the ambiguity for scoping.

quote:

Can you give an example for the event name case? I'm trying to think of one that has this clash.

If I remember correctly it was something similar to this: http://jsfiddle.net/u8g83/2/ / http://jsfiddle.net/u8g83/1/ - can't give you specifics though as it was some time ago. I memorized though not to bind events this way as you can't be sure what will be accessed - the global or local variable / function.

quote:

var name = 8 and this.name = 8 don't have the same meaning in JS. Ignoring that variable declaration and property assignment have somewhat different semantics, this is not usually the variables object. It's very easy to see by putting the code in a function.

In this particular example it is - I've oversimplified it; I can see why it is erroneous though and I don't know why I've written that, sorry. Reverted to less stupid.

canis minor fucked around with this message at 15:50 on Jul 26, 2014

Color Gray
Oct 10, 2005
BARF!

On a related note, I once saw someone link to this "rebuttal" to that article:

http://forums.devshed.com/php-development-5/php-fractal-bad-design-hardly-929746.html

Except that they ignored the part where the author of the article himself ("Eevee") shows up and (very politely) shits all over his arguments. :laugh:

Fake edit: I forgot that the guy attempting the rebuttal also gave us such gems as "JavaScript is not a loosely typed language." :downs:

Thermopyle
Jul 1, 2003

...the stupid are cocksure while the intelligent are full of doubt. —Bertrand Russell

Color Gray posted:

On a related note, I once saw someone link to this "rebuttal" to that article:

http://forums.devshed.com/php-development-5/php-fractal-bad-design-hardly-929746.html

Except that they ignored the part where the author of the article himself ("Eevee") shows up and (very politely) shits all over his arguments. :laugh:

Fake edit: I forgot that the guy attempting the rebuttal also gave us such gems as "JavaScript is not a loosely typed language." :downs:

Eevee posted:

For an anecdote about Wikipedia: a number of common templates are locked, because editing any of them would apparently cause so much load it would effectively take the site down.

What's that about?

ulmont
Sep 15, 2010

IF I EVER MISS VOTING IN AN ELECTION (EVEN AMERICAN IDOL) ,OR HAVE UNPAID PARKING TICKETS, PLEASE TAKE AWAY MY FRANCHISE

Thermopyle posted:

What's that about?

Wikipedia claims it's more because those templates are used so frequently that even temporary vandalism would be catastrophic:
http://en.m.wikipedia.org/wiki/Wikipedia:High-risk_templates

Sweevo
Nov 8, 2007

i sometimes throw cables away

i mean straight into the bin without spending 10+ years in the box of might-come-in-handy-someday first

im a fucking monster

code:
typedef struct {
  char *RuNnAMe;
  char *RuNnUMber;
  int RuNnUMber_s;
  char *TRACeNAMe;
  int TRACeNAMe_s;
} TRANsfer_t;
Whoever wrote that needs to go back to writing text files for 90s warez groups.

kitten smoothie
Dec 29, 2001

Sweevo posted:

code:
typedef struct {
  char *RuNnAMe;
  char *RuNnUMber;
  int RuNnUMber_s;
  char *TRACeNAMe;
  int TRACeNAMe_s;
} TRANsfer_t;
Whoever wrote that needs to go back to writing text files for 90s warez groups.

https://github.com/samplemaker/RS-423_oscilloscope_downloader/blob/master/main.c

Looks like this was a clue to help visually relate the value of that field back to what was actually being sent to the hardware ("TRAN:FILE:RNAM" for example is a command it writes down the serial port). But still whatever happened to abstraction.

RevengeOfLibo
Nov 20, 2002

This guy has the intelligence of a wilted cabbage...
A bit of code that builds some indexes for a medical records app I'm working on. Kudos to anyone who identifies the language.

code:
KBBMFS ;CLD/JPW - CLINICAL FLOWSHEETS;19 JUL 2014
;;0.01;KBBMFS;**PATCHES**;19 JUL 2014;Build 1
 Q
BIX N F,C,O,CN,CS,IX,DF,LN S (F,C,O,CN)="",LN="DEF",IX=$$GL(2),DF=$$GL(3),CS=$$GL(4) K @IX
    S F=$O(@DF@(F)) Q:F=""  S @IX@(@DF@(F))=F,C="" D
    .F  S C=$O(@DF@(F,C)) Q:C=""  S @IX@(@DF@(F),@DF@(F,C))=C,O="" D
    ..F  S O=$O(@DF@(F,C,O)) Q:O=""  S @IX@(@DF@(F),@DF@(F,C),@DF@(F,C,O))=O,CN=""  D
    ...F  S CN=$O(@DF@(F,C,O,CS,CN)) Q:CN=""  S @IX@(@DF@(F),@DF@(F,C),@DF@(F,C,O),CN)=@DF@(F,C,O,CS,CN,"label")
    Q
DEF ;^KBBMFSIX;^KBBMFS;Controls
    Q
GL(NM) S LN="DEF" Q $P($T(@LN),";",NM)

leterip
Aug 25, 2004
Medical records and gibberish? Gotta be MUMPS.

ohgodwhat
Aug 6, 2005

You didn't get sucked into Epic did you?

qntm
Jun 17, 2009
There's got to be a MUMPS Best Practices out there somewhere and it's just a single page which says "Don't abbreviate all your critical language constructs to a single character, you fool."

RevengeOfLibo
Nov 20, 2002

This guy has the intelligence of a wilted cabbage...

leterip posted:

Medical records and gibberish? Gotta be MUMPS.

Bingo!

ohgodwhat posted:

You didn't get sucked into Epic did you?

VistA, actually. FileMan > Chronicles.

Munkeymon
Aug 14, 2003

Motherfucker's got an
armor-piercing crowbar! Rigoddamndicu𝜆ous.



Has https://github.com/lismore/MathematicalInterfaceForLanguage been posted here yet?

Lumpy
Apr 26, 2002

La! La! La! Laaaa!



College Slice

"Effective communication depends upon the I.Q. level of both people involved in the exchange of information."

Please, go on....

Hammerite
Mar 9, 2007

And you don't remember what I said here, either, but it was pompous and stupid.
Jade Ear Joe
That's a reference to this guy by the way.

FoiledAgain
May 6, 2007


That's not even just a programming horror, there's a huge linguistic horror in there too: English cannot be described with only 10 parts of speech. Unless "Legal English" is some proper subset of English that only requires 10.

edit: oh I just saw the rationalwiki link. this isn't really even something worth responding to, is it?

double edit: wow this guy is insane: "David is an adjective, Wynn is an adjective, Miller is a pronoun. Two adjectives are a condition of modification, opinion, presumption, which modifies the pronoun, pro means no on noun. So therefore, I'm not a fact. I'm a fiction."

FoiledAgain fucked around with this message at 20:02 on Jul 29, 2014

Impotence
Nov 8, 2010
Lipstick Apathy
person before me left this




bonus: he used a library named php.js

Coffee Mugshot
Jun 26, 2010

by Lowtax
My favorite JS snippet

code:
a = {};
a["Infinity"] = "dicks";
a[1/0];

Lysidas
Jul 26, 2002

John Diefenbaker is a madman who thinks he's John Diefenbaker.
Pillbug
btrfs is in good hands:

quote:

From: Nicholas Krause <xerofoify <at> gmail.com>
Subject: [PATCH] Remove certain calls for releasing page cache
Newsgroups: gmane.linux.kernel, gmane.comp.file-systems.btrfs
Date: 2014-07-30 20:42:34 GMT (23 hours and 42 minutes ago)

This patch removes the lines for releasing the page cache in certain
files as this may aid in perfomance with writes in the compression
rountines of btrfs. Please note that this patch has not been tested
on my own hardware due to no compression based btrfs volumes of my
own.

Signed-off-by: Nicholas Krause <xerofoify <at> gmail.com>

actual diff is here if you're interested

quote:

From: Josef Bacik <jbacik <at> fb.com>
Subject: Re: [PATCH] Remove certain calls for releasing page cache
Newsgroups: gmane.comp.file-systems.btrfs, gmane.linux.kernel
Date: 2014-07-30 23:18:10 GMT (21 hours and 13 minutes ago)

So I'm going to list all the things that are wrong with this in the off chance that you will actually improve
and then go back to ignoring your emails.

1) You test your patches before you send them. Xfstests is how you test.

2) You seem to think page_cache_release releases the page cache. It doesn't, it releases a ref on the page,
we take a ref while we are doing IO and then drop it when we are done. It is not evicted from cache until the VM
decides to do it at some point in the future, so all your patch does is make us leak page cache.

3) You don't free the compressed pages. This leaks memory. These pages are only used for writing out, there
is absolutely no reason to keep them around after the IO is complete, we have the actual page with the real
data still in cache.

4) You also made it so we don't free the the struct we use to track the compressed IO, which is just as useless as
the compressed pages now, causing another memory leak.

Had you tested this patch it would have killed the box pretty quickly and you would have known all of this. But
you didn't, and wasted a lot of much smarter peoples time. This is not OK, this gets you ignored. Do not do it
again. Thanks,

Josef

quote:

From: Dave Airlie <airlied <at> gmail.com>
Subject: Re: [PATCH] Remove certain calls for releasing page cache
Newsgroups: gmane.linux.kernel, gmane.comp.file-systems.btrfs
Date: 2014-07-30 23:30:15 GMT (21 hours and 1 minute ago)

For all that is sacred, STOP.

Go and do something else, you are wasting people's valuable time,

Don't send any patches you haven't tested ever. If you aren't capable
of setting up a VM to run compressed btrfs volumes in, what makes you
think you can patch the code.

This isn't how you learn to be a kernel developer by wasting other
kernel developers time, if you can't work out why releasing the page cache
is necessary then don't send the patch until you have spent the time
understanding what the page cache is.

I know you'll just ignore this, and keep on trucking just like you ignored
the other messages from Stephen before.

But if you want to work on the kernel, this isn't the way to do it, and
nobody will ever take a patch from you seriously if you continue in this
fashion.

Dave.

ohgodwhat
Aug 6, 2005

lol

quote:

To: Linus Torvalds <torvalds@linux-foundation.org>
Subject: Re: Random panic in load_balance() with 3.16-rc
From: Nick Krause <xerofoify@gmail.com>
Date: Thu, 24 Jul 2014 22:50:19 -0400
On Thu, Jul 24, 2014 at 10:33 PM, Linus Torvalds
<torvalds@linux-foundation.org> wrote:
> On Thu, Jul 24, 2014 at 6:25 PM, Michel Dänzer <michel@daenzer.net> wrote:
*snip*
> Linus

Seems better after looking at it too, seems I don't need to test this and this
bug is in gcc 4.9 related versions.
Cheers Nick

Reach for the stars, dude

Strong Sauce
Jul 2, 2003

You know I am not really your father.





This guy is brilliant. It is literally your worst patch contributor come true.

Start here and keep clicking Next by Date: http://www.spinics.net/lists/linux-rdma/msg20450.html

gonadic io
Feb 16, 2011

>>=

Strong Sauce posted:

This guy is brilliant. It is literally your worst patch contributor come true.

Start here and keep clicking Next by Date: http://www.spinics.net/lists/linux-rdma/msg20450.html

This is incredible! A dozen emails, a half-dozen patches and absolutely nothing accomplished.

Lysidas
Jul 26, 2002

John Diefenbaker is a madman who thinks he's John Diefenbaker.
Pillbug
He's having a quasi-meltdown on the btrfs mailing list.

He submitted a patch that enabled a few more FALLOC_FL system call modes in the btrfs interface, without any supporting infrastructure to do anything at all with those flags.

Original thread: http://thread.gmane.org/gmane.linux.kernel/1760397

Hugo Mills patiently, helpfully says "please think through what the gently caress you're doing"

quote:

You've just enabled two options, but you haven't actually implemented the code behind it. I would tell you *NOT* to do anything else on this work until you can answer the question: What happens if you apply this patch, create a large file called "foo.txt", and then a userspace program executes the following code?

code:
int fd = open("foo.txt", O_RDWR);
fallocate(fd, FALLOCATE_FL_COLLAPSE_RANGE, 50, 50);
Try it on a btrfs filesystem, both with and without your patch. Also try it on an ext4 filesystem.

Once you've done all of that, reply to this mail and tell me what the problem is with this patch. You need to make two answers: what are the technical problems with the patch? What errors have you made in the development process?

Only if you can answer those questions sensibly, should you write any more patches, of any kind.

Hugo.

Follow-up thread: http://thread.gmane.org/gmane.comp.file-systems.btrfs/37358/focus=37367

Synopsis: Nick says (all paraphrased) "I've been trying to read the ext4 code...", Hugo says "btrfs is completely different on-disk, and again, please address the issues I mentioned last time", to which Nick replies

quote:

I believed I answered your questions , seems I need to loving test my patches. And about the reply about data structures , thanks seems the other fallocate functions are there and I need to read these first , I sent out my patch by accident as I didn't realize I have removed the error return by mistake.
Sorry Nick

(emphasis mine, in this last quote)

:psyduck:

Color Gray
Oct 10, 2005
BARF!
This response from Hugo Mills was really good (emphasis mine):

https://lkml.org/lkml/2014/7/31/194

Hugo Mills posted:

Date Thu, 31 Jul 2014 11:11:16 +0100
From Hugo Mills <>
Subject Re: [PATCH] Remove certain calls for releasing page cache

On Wed, Jul 30, 2014 at 10:05:16PM -0400, Nick Krause wrote:
> On Wed, Jul 30, 2014 at 7:30 PM, Dave Airlie <airlied@gmail.com> wrote:
> >> This patch removes the lines for releasing the page cache in certain
> >> files as this may aid in perfomance with writes in the compression
> >> rountines of btrfs. Please note that this patch has not been tested
> >> on my own hardware due to no compression based btrfs volumes of my
> >> own.
> >>
> >
> > For all that is sacred, STOP.
[snip]
> > But if you want to work on the kernel, this isn't the way to do it, and
> > nobody will ever take a patch from you seriously if you continue in this
> > fashion.
> >
> > Dave.
> Dave ,
> Seems I need to have tested this code first.

You've said this before, having made exactly the same error (not
testing a patch). Yet you do it again. You seem to be ignoring all the
advice you've been given -- or at least not learning from it, and not
learning from your experiences. Could you please, for half an hour or
so, stop thinking about the immediate goal of getting a patch into the
kernel, and take a short while to think about your process of
learning. Look at all the advice you've had (from me, from Ted, from
others), actually understand it, and consider all the things you need
to do which *aren't* hacking up a lump of C. Actually learn these
things -- have them in your mind all the time.

I would appreciate it if you could actually engage with someone
(doesn't have to be me) about this -- why are you ignoring the advice?
Is it because you don't understand it? Is it because you think you can
cut corners? Is it because you're concetrating on the code so much that
you're forgetting it?

The main thing you're doing which is making people angry is not
because you're submitting bad patches (although you are). It's because
you're not listening to advice, and you're not apparently learning
anything from the feedback you're given. Your behaviour is not
changing over time, which makes you look like a waste of time to all
those people trying to help you.


Hugo.

ohgodwhat
Aug 6, 2005

Googling his email address leads me to believe that all he does is go around and submit unwanted and bad patches without any sort of testing. I can't decide if it's an over enthusiastic ten year old or someone with a mental illness.

Carthag Tuek
Oct 15, 2005

Tider skal komme,
tider skal henrulle,
slægt skal følge slægters gang



Seems some bonehead is editing things in production: https://familysearch.org/search/collection/list click any of the "view images" links and check the console spit debug log crap, plus the images don't actually show up as they normally do.

Paul MaudDib
May 3, 2006

TEAM NVIDIA:
FORUM POLICE

Lysidas posted:

btrfs is in good hands:

Nick Krause is clearly a dumbass. Yeah, google his email and you come up with one bad, untested patch after another.

That said, page_cache_release seems like a dumb name for a method that doesn't actually release page cache. If it releases a reference to the page, why not name the method release_page_cache_reference instead?

pseudorandom name
May 6, 2007

Because "release" is commonly used purely to decrement a reference count and free if zero.

c.f. IUnknown, NSObject

Vanadium
Jan 8, 2005

I'm pretty impressed with the patience on display on the lkml, I'd have expected worse after things I've heard. :v:

I guess he's just some kid who's missing the forest for the trees and literally doing cargo-cult open source: he only sees other people write C code and submit patches and it's not getting through to him that he's missing the vast majority of the actual work that makes that possible in the first place.

Lysidas
Jul 26, 2002

John Diefenbaker is a madman who thinks he's John Diefenbaker.
Pillbug
I can't help myself. One more post.

http://thread.gmane.org/gmane.linux.kernel/1760397 again ("Add support to check for FALLOC_FL_COLLAPSE_RANGE and FALLOC_FL_ZERO_RANGE crap modes"):

Theodore Ts'o, primary developer of e2fsprogs, maintainer of ext4 posted:

There are also the conceptual failures. Before you do anything else, you need to be able to answer the question, "what do you think the flags FALLOC_FL_COLLAPSE_RANGE and FALLOC_FL_ZERO_RANGE are supposed to do?" What are the possible appropriate things for btrfs to do if it sees these flags? (Hint: there is more than one correct answer, and its current choice is one of them. What is the other one?)

Nick, the fact that you call these modes "crap" is a hint that you have a fundamental lack of understanding --- and before you waste more of kernel developers' time, you need to get that understanding first, for any bit of code that you propose to "improve".

This is why I suggested that you work on userspace testing scripts first. It's pretty clear you are (a) incredibly sloppy, and (b) lacking conceptual understanding of a lot of technical details, and (c) even worse, aren't letting this lack of understanding stop you from posting patches. As a result you are adding negative value to whatever project or subsystem you try to attach yourself to --- you're not helping.

Nick Krause posted:

I miss send this patch, that's my there are issues.
Cheers Nick

Adbot
ADBOT LOVES YOU

hobbesmaster
Jan 28, 2008

Paul MaudDib posted:

Nick Krause is clearly a dumbass. Yeah, google his email and you come up with one bad, untested patch after another.

That said, page_cache_release seems like a dumb name for a method that doesn't actually release page cache. If it releases a reference to the page, why not name the method release_page_cache_reference instead?

Its a reference counted object, you're releasing it in the same way you release a smart pointer.

  • 1
  • 2
  • 3
  • 4
  • 5
  • Post
  • Reply