Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 27 Sep 2005 21:43:37 +0400
From:      Roman Kurakin <rik@cronyx.ru>
To:        freebsd-current@freebsd.org, freebsd-hackers@freebsd.org
Subject:   LOR #55 fix proposal (kern_descrip.c patch)
Message-ID:  <433984C9.2040403@cronyx.ru>

next in thread | raw e-mail | index | archive | help
Hi,

    It seems that the LOR #55 
(http://sources.zabbadoz.net/freebsd/lor.html#055)
could be fixed by following patch. I need testers and reviewers of it 
since I want
to commit it.

    I do not see a reason why not to extend action of FILEDESC_LOCK.

(http://www.cronyx.ru/~rik/freebsd/lor055/lor55.pch)

Index: kern_descrip.c
===================================================================
RCS file: /home/ncvs/src/sys/kern/kern_descrip.c,v
retrieving revision 1.280
diff -u -r1.280 kern_descrip.c
--- kern_descrip.c      26 Aug 2005 11:16:39 -0000      1.280
+++ kern_descrip.c      27 Sep 2005 17:31:57 -0000
@@ -2275,7 +2275,6 @@
                        fdused(fdp, indx);
                if (fp != NULL)
                        FILE_LOCK(fp);
-               FILEDESC_UNLOCK(fdp);

                /*
                 * We now own the reference to fp that the ofiles[] array
@@ -2283,6 +2282,9 @@
                 */
                if (fp != NULL)
                        fdrop_locked(fp, td);
+
+               FILEDESC_UNLOCK(fdp);
+
                return (0);

        default:

Best regards,
                         rik




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?433984C9.2040403>