ALT Linux Team development discussions
 help / color / mirror / Atom feed
* [devel] BUG: uw-imap locking does not work on reiserfs
@ 2002-10-12 14:23 Sergey Vlasov
  2002-10-15 20:21 ` Ivan Zakharyaschev
  2002-10-18 21:24 ` fixed: " Ivan Zakharyaschev
  0 siblings, 2 replies; 4+ messages in thread
From: Sergey Vlasov @ 2002-10-12 14:23 UTC (permalink / raw)
  To: ALT Discussion List, Sisyphus ML; +Cc: ALT Developers List

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

В 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


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2002-10-19 16:17 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-10-12 14:23 [devel] BUG: uw-imap locking does not work on reiserfs Sergey Vlasov
2002-10-15 20:21 ` Ivan Zakharyaschev
2002-10-18 21:24 ` fixed: " Ivan Zakharyaschev
2002-10-19 16:17   ` Ivan Zakharyaschev

ALT Linux Team development discussions

This inbox may be cloned and mirrored by anyone:

	git clone --mirror http://lore.altlinux.org/devel/0 devel/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 devel devel/ http://lore.altlinux.org/devel \
		devel@altlinux.org devel@altlinux.ru devel@lists.altlinux.org devel@lists.altlinux.ru devel@linux.iplabs.ru mandrake-russian@linuxteam.iplabs.ru sisyphus@linuxteam.iplabs.ru
	public-inbox-index devel

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


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