ALT Linux Sisyphus discussions
 help / color / mirror / Atom feed
From: Sergey Vlasov <vsu@altlinux.ru>
To: ALT Discussion List <community@altlinux.ru>,
	Sisyphus ML <sisyphus@altlinux.ru>
Cc: ALT Developers List <devel@altlinux.ru>
Subject: [sisyphus] BUG: uw-imap locking does not work on reiserfs
Date: Sat, 12 Oct 2002 18:23:23 +0400
Message-ID: <20021012182323.5f35d14e.vsu@altlinux.ru> (raw)

Внимание, грабли!

В uw-imap (по крайней мере, в версии uw-imap-2001a-alt6) не работает
блокировка почтовых ящиков, если они находятся на файловой системе
reiserfs (проверено с ядром 2.4.18-up-alt8). На ext2, ext3 блокировка
работает. На других файловых системах тоже могут быть проблемы - не
проверял.

Ошибка может приводить к порче почтовых ящиков и потере сообщений.

Причина, похоже, в следующем куске кода (src/osdep/unix/nfstnew.c):

/* Test for NFS
 * Accepts: file descriptor
 * Returns: T if NFS file, NIL otherwise
 */

long test_nfs (int fd)
{
  struct stat sbuf;
  struct ustat usbuf;
  struct statvfs vsbuf;
  /* Any base type that begins with "nfs" or "afs" is considered to be a
   * network filesystem.
   */
  return ((!fstat (fd,&sbuf) && !ustat (sbuf.st_dev,&usbuf) &&
	   !++usbuf.f_tinode) ||
	  (!fstatvfs (fd,&vsbuf) && (vsbuf.f_basetype[1] == 'f') &&
	   (vsbuf.f_basetype[2] == 's') &&
	   ((vsbuf.f_basetype[0] == 'n') || (vsbuf.f_basetype[0] == 'a')))) ?
	     LONGT : NIL;
}

На reiserfs функция ustat возвращает f_tinode == -1, в результате чего
uw-imap считает, что работает с NFS, и прекращает использовать
блокировки через fcntl (остается только dotlock, но этот метод не
работает с системными ящиками в /var/spool/mail).

-- 
Sergey Vlasov


             reply	other threads:[~2002-10-12 14:23 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-10-12 14:23 Sergey Vlasov [this message]
2002-10-15 20:21 ` [sisyphus] Re: [devel] " Ivan Zakharyaschev

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20021012182323.5f35d14e.vsu@altlinux.ru \
    --to=vsu@altlinux.ru \
    --cc=community@altlinux.ru \
    --cc=devel@altlinux.ru \
    --cc=sisyphus@altlinux.ru \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

ALT Linux Sisyphus discussions

This inbox may be cloned and mirrored by anyone:

	git clone --mirror http://lore.altlinux.org/sisyphus/0 sisyphus/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 sisyphus sisyphus/ http://lore.altlinux.org/sisyphus \
		sisyphus@altlinux.ru sisyphus@altlinux.org sisyphus@lists.altlinux.org sisyphus@lists.altlinux.ru sisyphus@lists.altlinux.com sisyphus@linuxteam.iplabs.ru sisyphus@list.linux-os.ru
	public-inbox-index sisyphus

Example config snippet for mirrors.
Newsgroup available over NNTP:
	nntp://lore.altlinux.org/org.altlinux.lists.sisyphus


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git