
{"id":6403,"date":"2011-12-10T10:24:11","date_gmt":"2011-12-10T10:24:11","guid":{"rendered":"http:\/\/www.beautifulwork.org\/?p=6403"},"modified":"2011-12-10T10:24:11","modified_gmt":"2011-12-10T10:24:11","slug":"patch-udf-fix-deadlock-when-converting-file-from-in-icb-one-to-normal-one","status":"publish","type":"post","link":"https:\/\/www.trueangle.org\/index.php\/2011\/12\/10\/patch-udf-fix-deadlock-when-converting-file-from-in-icb-one-to-normal-one\/","title":{"rendered":"[PATCH] udf: Fix deadlock when converting file from in-ICB one to normal one"},"content":{"rendered":"<h4><u>[PATCH] udf: Fix deadlock when converting file from in-ICB one to normal one<\/u><\/h4>\n<pre>\nDuring  BKL removal,  conversion  of files  from  in-ICB format  to\nnormal format got broken.  We call -&gt;writepage with i_data_sem held\nbut  udf_get_block()  also acquires  i_data_sem  thus creating  A-A\ndeadlock.\n\nWe  fix   the  problem   by  dropping  i_data_sem   before  calling\n-&gt;writepage() which is safe since i_mutex still protects us against\nany  changes in  the  file.  Also fix  pagelock  - i_data_sem  lock\ninversion  in   udf_expand_file_adinicb()  by  dropping  i_data_sem\nbefore calling find_or_create_page().\n\n<\/pre>\n<p>\nBig Kernel Lock<\/p>\n<pre>\nLinux  contains  a  global   kernel  lock,  kernel_flag,  that  was\noriginally introduced  in kernel 2.0  as the only SMP  lock. During\n2.2 and 2.4, much work went  into removing the global lock from the\nkernel and replacing it  with finer-grained localized locks. Today,\nthe global  lock's use  is minimal. It  still exists,  however, and\ndevelopers need to be aware of it.\n\nThe global kernel lock is called  the big kernel lock or BKL. It is\na  spinning  lock  that  is recursive;  therefore  two  consecutive\nrequests for it will not deadlock  the process (as they would for a\nspinlock).  Further,  a  process  can  sleep  and  even  enter  the\nscheduler while  holding the  BKL. When a  process holding  the BKL\nenters the  scheduler, the lock  is dropped so other  processes can\nobtain it. These attributes of the BKL helped ease the introduction\nof SMP  during the 2.0  kernel series. Today, however,  they should\nprovide plenty of reason not to use the lock.\n\nsource : http:\/\/www.linuxjournal.com\/article\/5833?page=0,2\n<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>[PATCH] udf: Fix deadlock when converting file from in-ICB one to normal one During BKL removal, conversion of files from in-ICB format to normal format got broken. We call -&gt;writepage with i_data_sem held but udf_get_block() also acquires i_data_sem thus creating A-A deadlock. We fix the problem by dropping i_data_sem before calling -&gt;writepage() which is safe &hellip; <\/p>\n<p class=\"link-more\"><a href=\"https:\/\/www.trueangle.org\/index.php\/2011\/12\/10\/patch-udf-fix-deadlock-when-converting-file-from-in-icb-one-to-normal-one\/\" class=\"more-link\">Continue reading<span class=\"screen-reader-text\"> &#8220;[PATCH] udf: Fix deadlock when converting file from in-ICB one to normal one&#8221;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[1],"tags":[],"_links":{"self":[{"href":"https:\/\/www.trueangle.org\/index.php\/wp-json\/wp\/v2\/posts\/6403"}],"collection":[{"href":"https:\/\/www.trueangle.org\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.trueangle.org\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.trueangle.org\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.trueangle.org\/index.php\/wp-json\/wp\/v2\/comments?post=6403"}],"version-history":[{"count":0,"href":"https:\/\/www.trueangle.org\/index.php\/wp-json\/wp\/v2\/posts\/6403\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.trueangle.org\/index.php\/wp-json\/wp\/v2\/media?parent=6403"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.trueangle.org\/index.php\/wp-json\/wp\/v2\/categories?post=6403"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.trueangle.org\/index.php\/wp-json\/wp\/v2\/tags?post=6403"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}