Getting Dirty with OpenBSD and mail serving

Getting Dirty with OpenBSD and mail serving

Post by Lance Nichol » Wed, 30 Jan 2002 11:42:47



Good god, what have I done?

I have taken the plunge into the *nix world after studying for some time
what I wanted to do. Like amny people, I want to learn more about the
lay of the land. I have limited experiance from about 15-20 years ago
when I used to bash (pun intended) arround on an account set up by my
Dad on a office system. Can I remember much? Less then I though I could
:)

My other reason is to set up a secure enviroment at home, and set up www
and mail servers on older, unused boxes. So now that I have bashed my
way though installing OpenBSD 3.0 on a deskpro (tricky that is) I have
managed to configure sendmail to SEND, but I can't seem to get mail to
arrive to my account(s) I have set up on the server.

The mail is not bounced, nothing, it just disapears into limbo. Testing
using Outlook XP's test function let me log into the account, but there
is no mail to retrieve, and if I logon to the server directly there is
no mail on my account.

Pinging the servername from my workstation get me this error: "Ping
request could not find host deskpro.pt-cruiser.net. Please check the
name and try again."

Pinging the servername from the server itself brings back replys pretty
quickly. Sub ms times infact.

The server is behind a hardware NAT firewall/router, and the ports 110
and 25 are forwared to the internal IP.

So, what should I be looking for, and what have I missed? Is this a DNS
issue? Many thanks from someone stuggling to learn new stuff, and
unlearn old stuff.

Lance

remove zeds to reply via mail

--
"They have two settings, stun and kill;It would be best not to confuse
them."

 
 
 

Getting Dirty with OpenBSD and mail serving

Post by Ted » Wed, 30 Jan 2002 11:53:51



> So, what should I be looking for, and what have I missed? Is this a DNS
> issue? Many thanks from someone stuggling to learn new stuff, and
> unlearn old stuff.

Probably.  Sendmail tries to figure out the hostname it's supposed to
receive mail for, and if you're NATing than it's probably not getting the
right answers.  Try adding a line like this to /etc/sendmail.cf:
Djhostname.domain.net
for the appropriate value of hostname.domain.net.

--

"Welcome to Stanford.  There are no walls.  No guards.  But the campus
 is three weeks in every direction.  There is no escape, except death."

 
 
 

Getting Dirty with OpenBSD and mail serving

Post by fb » Wed, 30 Jan 2002 12:19:22


You might also try telnet yourhost 110 and see if you can manually
login using smtp commands. ? shows the commands.

Sounds like you are not getting mail for some reason though..
Maybe the previous answer will resolve it.

You do need a local nameserver on the box that has the mail server
(at least that's what I do).

fb


> > So, what should I be looking for, and what have I missed? Is this a DNS
> > issue? Many thanks from someone stuggling to learn new stuff, and
> > unlearn old stuff.

> Probably.  Sendmail tries to figure out the hostname it's supposed to
> receive mail for, and if you're NATing than it's probably not getting the
> right answers.  Try adding a line like this to /etc/sendmail.cf:
> Djhostname.domain.net
> for the appropriate value of hostname.domain.net.

> --

> "Welcome to Stanford.  There are no walls.  No guards.  But the campus
>  is three weeks in every direction.  There is no escape, except death."

 
 
 

Getting Dirty with OpenBSD and mail serving

Post by Nate Vanderschaa » Wed, 30 Jan 2002 12:27:37


Lance, your problem is indeed a DNS one.  (At least).  You have successfully
set up the MX record, but you haven't defined an  A record for
deskpro.pt-cruiser.net.

Why does it work from the server itself?  It doesn't even query a real DNS,
it queries itself.  hosts file most likely.  (Depending upon how you have it
set up).  Sub-ms times are simple because the ping never goes deeper than
the driver (or the IP stack inside it) so it only needs to go to RAM and
back.  Really, never even gets to the card.

Go back and the A record, wait out the TTL (usually about a day) and mail
should start arriving.  In fact, mail sent out already is likely queued up
at relay2.exodus.net and will likely start arriving at
deskpro.pt-cruiser.net once the DNS record is updated (unless it bounces
back first).

Do you want a recomended reading list?

 "DNS and BIND", O'Reilly publishers.  Get the latest edition, man, this
thing is the bible when it comes to DNS.  Cheapest place is www.bookpool.com

For Unix Admin, get "Essential System Administration."  O'Reilly publishers.
Latest edition is like 5 years old and still kicks ass.  It's a must have.
Also available at www.bookpool.com

The only OpenBSD book in print, "Building Linux and OpenBSD Firewalls."
Wiley Publishers.  I got mine from Amazon.  It's not a must have, but it's
not bad.

Here's output for ya:  (I'm* my head in shame because of the C:
prompt).
/********begin paste***************/

C:\>nslookup
Default Server:  phobos.frii.com
Address:  216.17.128.1

Quote:> set type=mx
> pt-cruiser.net

Server:  phobos.frii.com
Address:  216.17.128.1

Non-authoritative answer:
pt-cruiser.net  MX preference = 20, mail exchanger = relay1.exodus.net
pt-cruiser.net  MX preference = 10, mail exchanger = deskpro.pt-cruiser.net
pt-cruiser.net  MX preference = 20, mail exchanger = relay2.exodus.net

pt-cruiser.net  nameserver = dns11.register.com
pt-cruiser.net  nameserver = dns12.register.com
dns11.register.com      internet address = 216.21.234.76
dns12.register.com      internet address = 209.67.50.234

Quote:> server dns11.register.com

Default Server:  dns11.register.com
Address:  216.21.234.76

Quote:> set type=mx
> pt-cruiser.net

Server:  dns11.register.com
Address:  216.21.234.76

pt-cruiser.net  MX preference = 20, mail exchanger = relay2.exodus.net
pt-cruiser.net  MX preference = 20, mail exchanger = relay1.exodus.net
pt-cruiser.net  MX preference = 10, mail exchanger = deskpro.pt-cruiser.net
pt-cruiser.net  nameserver = dns11.register.com
pt-cruiser.net  nameserver = dns12.register.com

Quote:> set type=any
> pt-cruiser.net

Server:  dns11.register.com
Address:  216.21.234.76

pt-cruiser.net  internet address = 24.101.223.154
pt-cruiser.net  nameserver = dns11.register.com
pt-cruiser.net  nameserver = dns12.register.com
pt-cruiser.net
        primary name server = dns11.register.com
        responsible mail addr = root.register.com
        serial  = 2000031106
        refresh = 10800 (3 hours)
        retry   = 86400 (1 day)
        expire  = 604800 (7 days)
        default TTL = 3600 (1 hour)
pt-cruiser.net  MX preference = 10, mail exchanger = deskpro.pt-cruiser.net
pt-cruiser.net  MX preference = 20, mail exchanger = relay2.exodus.net
pt-cruiser.net  MX preference = 20, mail exchanger = relay1.exodus.net
pt-cruiser.net  nameserver = dns11.register.com
pt-cruiser.net  nameserver = dns12.register.com

Quote:> exit

C:\>ping deskpro.pt-cruiser.net
Unknown host deskpro.pt-cruiser.net.

/*******************End paste**************/

You are on your way.

Nate Vanderschaaf


Quote:> Good god, what have I done?

> I have taken the plunge into the *nix world after studying for some time
> what I wanted to do. Like amny people, I want to learn more about the
> lay of the land. I have limited experiance from about 15-20 years ago
> when I used to bash (pun intended) arround on an account set up by my
> Dad on a office system. Can I remember much? Less then I though I could
> :)

> My other reason is to set up a secure enviroment at home, and set up www
> and mail servers on older, unused boxes. So now that I have bashed my
> way though installing OpenBSD 3.0 on a deskpro (tricky that is) I have
> managed to configure sendmail to SEND, but I can't seem to get mail to
> arrive to my account(s) I have set up on the server.

> The mail is not bounced, nothing, it just disapears into limbo. Testing
> using Outlook XP's test function let me log into the account, but there
> is no mail to retrieve, and if I logon to the server directly there is
> no mail on my account.

> Pinging the servername from my workstation get me this error: "Ping
> request could not find host deskpro.pt-cruiser.net. Please check the
> name and try again."

> Pinging the servername from the server itself brings back replys pretty
> quickly. Sub ms times infact.

> The server is behind a hardware NAT firewall/router, and the ports 110
> and 25 are forwared to the internal IP.

> So, what should I be looking for, and what have I missed? Is this a DNS
> issue? Many thanks from someone stuggling to learn new stuff, and
> unlearn old stuff.

> Lance

> remove zeds to reply via mail

> --
> "They have two settings, stun and kill;It would be best not to confuse
> them."

 
 
 

Getting Dirty with OpenBSD and mail serving

Post by Lance Nichol » Thu, 31 Jan 2002 08:52:33




Quote:> Lance, your problem is indeed a DNS one.  (At least).  You have
> successfully set up the MX record, but you haven't defined an  A
> record for deskpro.pt-cruiser.net.

Many thanks!

Quote:

> Why does it work from the server itself?  It doesn't even query a real
> DNS, it queries itself.  hosts file most likely.  (Depending upon how
> you have it set up).  Sub-ms times are simple because the ping never
> goes deeper than the driver (or the IP stack inside it) so it only
> needs to go to RAM and back.  Really, never even gets to the card.

This is what I suspected on this side, either that, or it was going out
to the router and back.

Quote:

> Go back and the A record, wait out the TTL (usually about a day) and
> mail should start arriving.  In fact, mail sent out already is likely
> queued up at relay2.exodus.net and will likely start arriving at
> deskpro.pt-cruiser.net once the DNS record is updated (unless it
> bounces back first).

Thanks, I have done that.

Quote:> Do you want a recomended reading list?

>  "DNS and BIND", O'Reilly publishers.  Get the latest edition, man,
>  this
> thing is the bible when it comes to DNS.  Cheapest place is
> www.bookpool.com

> For Unix Admin, get "Essential System Administration."  O'Reilly
> publishers. Latest edition is like 5 years old and still kicks ass.
> It's a must have. Also available at www.bookpool.com

I looked at the book below, and had not decided on getting it yet, as the
filter software has changed, thanks to that * bit of infighting. I
will look at it again.

Quote:> The only OpenBSD book in print, "Building Linux and OpenBSD
> Firewalls." Wiley Publishers.  I got mine from Amazon.  It's not a
> must have, but it's not bad.

> Here's output for ya:  (I'm* my head in shame because of the C:
> prompt).
> /********begin paste***************/

> C:\>nslookup
> Default Server:  phobos.frii.com
> Address:  216.17.128.1

>> set type=mx
>> pt-cruiser.net
> Server:  phobos.frii.com
> Address:  216.17.128.1

> Non-authoritative answer:
> pt-cruiser.net  MX preference = 20, mail exchanger = relay1.exodus.net
> pt-cruiser.net  MX preference = 10, mail exchanger =
> deskpro.pt-cruiser.net pt-cruiser.net  MX preference = 20, mail
> exchanger = relay2.exodus.net

> pt-cruiser.net  nameserver = dns11.register.com
> pt-cruiser.net  nameserver = dns12.register.com
> dns11.register.com      internet address = 216.21.234.76
> dns12.register.com      internet address = 209.67.50.234
>> server dns11.register.com
> Default Server:  dns11.register.com
> Address:  216.21.234.76

>> set type=mx
>> pt-cruiser.net
> Server:  dns11.register.com
> Address:  216.21.234.76

> pt-cruiser.net  MX preference = 20, mail exchanger = relay2.exodus.net
> pt-cruiser.net  MX preference = 20, mail exchanger = relay1.exodus.net
> pt-cruiser.net  MX preference = 10, mail exchanger =
> deskpro.pt-cruiser.net pt-cruiser.net  nameserver = dns11.register.com
> pt-cruiser.net  nameserver = dns12.register.com
>> set type=any
>> pt-cruiser.net
> Server:  dns11.register.com
> Address:  216.21.234.76

> pt-cruiser.net  internet address = 24.101.223.154
> pt-cruiser.net  nameserver = dns11.register.com
> pt-cruiser.net  nameserver = dns12.register.com
> pt-cruiser.net
>         primary name server = dns11.register.com
>         responsible mail addr = root.register.com
>         serial  = 2000031106
>         refresh = 10800 (3 hours)
>         retry   = 86400 (1 day)
>         expire  = 604800 (7 days)
>         default TTL = 3600 (1 hour)
> pt-cruiser.net  MX preference = 10, mail exchanger =
> deskpro.pt-cruiser.net pt-cruiser.net  MX preference = 20, mail
> exchanger = relay2.exodus.net pt-cruiser.net  MX preference = 20, mail
> exchanger = relay1.exodus.net pt-cruiser.net  nameserver =
> dns11.register.com pt-cruiser.net  nameserver = dns12.register.com
>> exit

> C:\>ping deskpro.pt-cruiser.net
> Unknown host deskpro.pt-cruiser.net.

> /*******************End paste**************/

> You are on your way.

> Nate Vanderschaaf

Once again, I thank you. Humbling experinace this is turning into.

--
"They have two settings, stun and kill;It would be best not to confuse
them."

 
 
 

Getting Dirty with OpenBSD and mail serving

Post by Lance Nichol » Thu, 31 Jan 2002 09:17:21




Quote:> Lance, your problem is indeed a DNS one.  (At least).  You have
> successfully set up the MX record, but you haven't defined an  A
> record for deskpro.pt-cruiser.net.

<snips>

Nate, I wanted to thank you again, and lean on your expertise again.
Perhaps this following question should be posted in comp.sendmail.*

The record seems to have propigated, but now the mail is getting bounced
back to the recipient with the following:

I have started to read a copy of the sendmail "bat" book. Good greif is
it think! Either that, or I am. LOL

+++begin paste+++

This Message was undeliverable due to the following reason:

Each of the following recipients was rejected by a remote mail server.
The reasons given by the server are included to help you determine why
each recipient was rejected.




if you feel this message to be in error.

Reporting-MTA: dns; fep04-imail.bloor.is.net.cable.rogers.com
Arrival-Date: Tue, 29 Jan 2002 19:13:05 -0500
Received-From-MTA: dns; JLH (24.101.223.154)


Action: failed
Status: 5.1.1
Remote-MTA: dns; deskpro.pt-cruiser.net (24.101.223.154)

denied

+++End Paste+++

--
"They have two settings, stun and kill;It would be best not to confuse
them."

 
 
 

Getting Dirty with OpenBSD and mail serving

Post by fb » Thu, 31 Jan 2002 12:29:14


Lance-

You need to edit /etc/mail/sendmail.cf and add your ISP's smtp server
after the line DS under Smart relay host ie:
DSsmtp.myisp.com

Your isp probably has port 25 "blocked"..so that it will only pass
traffic originated from an authorized user. If you add that
line, all your outgoing mail will be allowed to relay though
your isp.

You may also want to add a relay-domains file in your /etc/mail
directory with something like this:

192.168.0
mydomain.com

Good luck..sounds like your about there.

Fred




> > Lance, your problem is indeed a DNS one.  (At least).  You have
> > successfully set up the MX record, but you haven't defined an  A
> > record for deskpro.pt-cruiser.net.
> <snips>

> Nate, I wanted to thank you again, and lean on your expertise again.
> Perhaps this following question should be posted in comp.sendmail.*

> The record seems to have propigated, but now the mail is getting bounced
> back to the recipient with the following:

> I have started to read a copy of the sendmail "bat" book. Good greif is
> it think! Either that, or I am. LOL

> +++begin paste+++

> This Message was undeliverable due to the following reason:

> Each of the following recipients was rejected by a remote mail server.
> The reasons given by the server are included to help you determine why
> each recipient was rejected.




> if you feel this message to be in error.

> Reporting-MTA: dns; fep04-imail.bloor.is.net.cable.rogers.com
> Arrival-Date: Tue, 29 Jan 2002 19:13:05 -0500
> Received-From-MTA: dns; JLH (24.101.223.154)


> Action: failed
> Status: 5.1.1
> Remote-MTA: dns; deskpro.pt-cruiser.net (24.101.223.154)

> denied

> +++End Paste+++

> --
> "They have two settings, stun and kill;It would be best not to confuse
> them."

 
 
 

Getting Dirty with OpenBSD and mail serving

Post by Nate Vanderschaa » Thu, 31 Jan 2002 12:42:21


Lance, do you know what mail relaying is?  In the old days, circa 1992, if
you wanted to send mail, you just put in your source and destination email
addresses, and drop it off at the nearest email server.  That SMTP server
would relay it to the correct destination, even though you didn't have a box
on that system.  Everyone was happy.

Then came spam.  Spammers preferred method is to bounce it off an SMTP
relay.  So an effort was put forth to stop spam; Open Relays have been
mostly closed off.  All email must be sent through your mail server.  If
not, you will end up on the list at www.spamcop.net or at www.orbz.org.  You
don't want that to happen to your server; most other servers store a list of
spam sources and completely reject mail from those sources.  Let me warn you
now, don't ever open the relay.  Also, don't send spam from your server, or
you will lose the ability to send email and will likely lose your cable
modem.  Anyway, OpenBSD, being such a world-class product, comes with the
relaying closed by default.  It looks like your OpenBSD box doesn't know
that it's the final recipient for mail for the pt-cruiser.net domain.  Check
your sendmail book to figure it out.  BTW, use postfix www.postfix.com
instead of sendmail.  (once you figure out sendmail).  I'd tell you how to
fix this, but I don't know how to set up sendmail.  (Really, I don't).

Also, do your testing between a hotmail account or something.  It will make
your life easier.

So far, your ip address is clean.

http://www.orbz.org/b.php?24.101.223.154

Good Luck

Nate




> > Lance, your problem is indeed a DNS one.  (At least).  You have
> > successfully set up the MX record, but you haven't defined an  A
> > record for deskpro.pt-cruiser.net.
> <snips>

> Nate, I wanted to thank you again, and lean on your expertise again.
> Perhaps this following question should be posted in comp.sendmail.*

> The record seems to have propigated, but now the mail is getting bounced
> back to the recipient with the following:

> I have started to read a copy of the sendmail "bat" book. Good greif is
> it think! Either that, or I am. LOL

> +++begin paste+++

> This Message was undeliverable due to the following reason:

> Each of the following recipients was rejected by a remote mail server.
> The reasons given by the server are included to help you determine why
> each recipient was rejected.




> if you feel this message to be in error.

> Reporting-MTA: dns; fep04-imail.bloor.is.net.cable.rogers.com
> Arrival-Date: Tue, 29 Jan 2002 19:13:05 -0500
> Received-From-MTA: dns; JLH (24.101.223.154)


> Action: failed
> Status: 5.1.1
> Remote-MTA: dns; deskpro.pt-cruiser.net (24.101.223.154)

> denied

> +++End Paste+++

> --
> "They have two settings, stun and kill;It would be best not to confuse
> them."

 
 
 

Getting Dirty with OpenBSD and mail serving

Post by Lance Nichol » Thu, 31 Jan 2002 21:25:55


Fred, thanks I will try this. I don't know if this is the case or not.
on inspired lunacy last night after my posting I tried emailing to

Time to hit sendmail.org and see what configs I have messed up. Either
that or it is still a DNS issue.



Quote:> Lance-

> You need to edit /etc/mail/sendmail.cf and add your ISP's smtp server
> after the line DS under Smart relay host ie:
> DSsmtp.myisp.com

> Your isp probably has port 25 "blocked"..so that it will only pass
> traffic originated from an authorized user. If you add that
> line, all your outgoing mail will be allowed to relay though
> your isp.

> You may also want to add a relay-domains file in your /etc/mail
> directory with something like this:

> 192.168.0
> mydomain.com

> Good luck..sounds like your about there.

> Fred

<snips>

- Show quoted text -

>> Nate, I wanted to thank you again, and lean on your expertise again.
>> Perhaps this following question should be posted in comp.sendmail.*

>> The record seems to have propigated, but now the mail is getting
>> bounced back to the recipient with the following:

>> I have started to read a copy of the sendmail "bat" book. Good greif
>> is it think! Either that, or I am. LOL

>> +++begin paste+++

>> This Message was undeliverable due to the following reason:

>> Each of the following recipients was rejected by a remote mail
>> server. The reasons given by the server are included to help you
>> determine why each recipient was rejected.




>> if you feel this message to be in error.

>> Reporting-MTA: dns; fep04-imail.bloor.is.net.cable.rogers.com
>> Arrival-Date: Tue, 29 Jan 2002 19:13:05 -0500
>> Received-From-MTA: dns; JLH (24.101.223.154)


>> Action: failed
>> Status: 5.1.1
>> Remote-MTA: dns; deskpro.pt-cruiser.net (24.101.223.154)

>> Relaying denied

>> +++End Paste+++

<snips>

--
"They have two settings, stun and kill;It would be best not to confuse
them."

 
 
 

Getting Dirty with OpenBSD and mail serving

Post by Lance Nichol » Fri, 01 Feb 2002 08:21:12




Quote:> Lance, do you know what mail relaying is?  In the old days, circa
> 1992, if you wanted to send mail, you just put in your source and
> destination email addresses, and drop it off at the nearest email
> server.  That SMTP server would relay it to the correct destination,
> even though you didn't have a box on that system.  Everyone was happy.

<snips>

Yeah, I understand the concept of relaying. I think, all this has gotten
me thinking about some assumptions I had of my knowledge. MCSE don't mean
a thing, even after being admin on a LAN for sometime. LOL

Quote:> Then came spam.  Spammers preferred method is to bounce it off an SMTP
> relay.  So an effort was put forth to stop spam; Open Relays have been
> mostly closed off.  All email must be sent through your mail server.
> If not, you will end up on the list at www.spamcop.net or at
> www.orbz.org.  You don't want that to happen to your server; most
> other servers store a list of spam sources and completely reject mail
> from those sources.  

I am trying my damndest not to let that happen to me...

Let me warn you now, don't ever open the relay.

Until I have this sorted out I have even disallowed relaying on my own
LAN segment. I don't need to be seen as a spammer...

Quote:> Also, don't send spam from your server, or you will lose the ability
> to send email and will likely lose your cable modem.  

good holy lord no! I get enough of the cr*p myself, I don't kneed to
inflict it on others.

Anyway, OpenBSD,

Quote:> being such a world-class product, comes with the relaying closed by
> default.  It looks like your OpenBSD box doesn't know that it's the
> final recipient for mail for the pt-cruiser.net domain.  
> Check your sendmail book to figure it out.  BTW, use postfix
www.postfix.com
> instead of sendmail.  ...  I'd tell you
> how to fix this, but I don't know how to set up sendmail.  (Really, I
> don't).

No problem, I appreciate the help, and I know now that I have a lot to
learn/unlearn.

Quote:> Also, do your testing between a hotmail account or something.  It will
> make your life easier.

> So far, your ip address is clean.

> http://www.orbz.org/b.php?24.101.223.154

> Good Luck

> Nate

--
"They have two settings, stun and kill; It would be best not to confuse
them."
 
 
 

Getting Dirty with OpenBSD and mail serving

Post by M?ns Nilss » Mon, 04 Feb 2002 22:18:51


Thus spoke Ted U:


>> So, what should I be looking for, and what have I missed? Is this a DNS
>> issue? Many thanks from someone stuggling to learn new stuff, and
>> unlearn old stuff.

>Probably.  Sendmail tries to figure out the hostname it's supposed to
>receive mail for, and if you're NATing than it's probably not getting the
>right answers.  Try adding a line like this to /etc/sendmail.cf:
>Djhostname.domain.net
>for the appropriate value of hostname.domain.net.

Ehrm.

Use the m4 method of building a new sendmail.cf instead of wreaking
havoc in the config file.

Read  /usr/share/sendmail/README and take it from there.

And the /real/ problem, failing reverse lookups, is best solved by
setting up reverse DNS for your RFC1918 netblock. That, properly done,
will cure the sendmail problem.

--
M?ns Nilsson                           MN1334-RIPE    
http://vvv.besserwisser.org            

 
 
 

Getting Dirty with OpenBSD and mail serving

Post by Lance Nichol » Sun, 10 Feb 2002 09:52:45




> Thus spoke Ted U:

>>> So, what should I be looking for, and what have I missed? Is this a
>>> DNS issue? Many thanks from someone stuggling to learn new stuff,
>>> and unlearn old stuff.

>>Probably.  Sendmail tries to figure out the hostname it's supposed to
>>receive mail for, and if you're NATing than it's probably not getting
>>the right answers.  Try adding a line like this to /etc/sendmail.cf:
>>Djhostname.domain.net
>>for the appropriate value of hostname.domain.net.

> Ehrm.

> Use the m4 method of building a new sendmail.cf instead of wreaking
> havoc in the config file.

> Read  /usr/share/sendmail/README and take it from there.

> And the /real/ problem, failing reverse lookups, is best solved by
> setting up reverse DNS for your RFC1918 netblock. That, properly done,
> will cure the sendmail problem.

Thank you, I have been investigating that issue this week, and trying to
learn the m4 system for sendmail.

--
"They have two settings, stun and kill; It would be best not to confuse
them."

 
 
 

1. 2.4.19 place buffer dirtied in truncate() on inode's dirty data list

This is for 2.4.x:

block_truncate_page() does a __mark_buffer_dirty(bh) at the end, but it
does not file the buffer on the inode's dirty data queue, so only
bdflush can ever get to it, and other sync mechanisms which call
fsync_inode_data_buffers() do not see it.

This was causing a particular problem with O_DIRECT on an xfs
filesystem, since O_DIRECT tries to sync before doing the I/O.
Following a truncate(), O_DIRECT reads of the last block were not
returning the correct data, since the truncate never got synced down to
disk.

ext2 does not seem to be able to do an O_DIRECT read of the last
filesytem block, unless the file size is a multiple of block size, so it
doesn't show up there.

--- linux/fs/buffer.c_1.109     Mon Sep 23 13:10:56 2002

        flush_dcache_page(page);
        kunmap(page);

-       __mark_buffer_dirty(bh);
+       if (!atomic_set_buffer_dirty(bh)) {
+               __mark_dirty(bh);
+               buffer_insert_inode_data_queue(bh, inode);
+               balance_dirty();
+       }
+
        err = 0;

The balance_dirty() call is debatable, Andrew Morton pointed out that it
does add a bit more risk.  OTOH, if you go off and truncate a million
files in a row, you'll be in sorry shape without it.

2.5 apparently does not have this problem, it calls mark_buffer_dirty()
which seems to take care of things.

-Eric

--
Eric Sandeen      XFS for Linux     http://oss.sgi.com/projects/xfs

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in

More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

2. Network Time Protocol

3. Getting down and dirty with serial ports

4. Intel Video Card Problem

5. Shakira getting dirty with dildo

6. Stealth 64 DRAM can't display anything more than 80 Mhz bandwidth

7. Matrox Mystique ands X.

8. Named Pipes

9. HELP: fetchmail gets stuck getting mail over PPP

10. Help for getting mail from ISP to my mail spool.

11. win95 client gets mail through linux machine from netware 3.xx mail server, POSSIBLE ?

12. Getting httpd to serve Mac Binhex

13. Getting Mail headers without mail prog???