]> git.hungrycats.org Git - linux/commitdiff
NTFS: Provide exclusion between opening an inode / mapping an mft record
authorAnton Altaparmakov <aia21@cantab.net>
Tue, 12 Oct 2004 10:27:35 +0000 (11:27 +0100)
committerAnton Altaparmakov <aia21@cantab.net>
Tue, 12 Oct 2004 10:27:35 +0000 (11:27 +0100)
      and accessing the mft record in fs/ntfs/mft.c::ntfs_mft_writepage()
      by setting the page not uptodate throughout ntfs_mft_writepage().

Signed-off-by: Anton Altaparmakov <aia21@cantab.net>
fs/ntfs/ChangeLog
fs/ntfs/mft.c

index a3ded99e9a0286631ae8e583bff11cbc116cc387..a59525b28152006341fa190f00d6713b56751bfc 100644 (file)
@@ -82,6 +82,9 @@ ToDo/Notes:
          extend the initialized size.
        - Map the page instead of using page_address() before writing to it in
          fs/ntfs/aops.c::ntfs_mft_writepage().
+       - Provide exclusion between opening an inode / mapping an mft record
+         and accessing the mft record in fs/ntfs/mft.c::ntfs_mft_writepage()
+         by setting the page not uptodate throughout ntfs_mft_writepage().
 
 2.1.20 - Fix two stupid bugs introduced in 2.1.18 release.
 
index 32580f2f3e2e3369549684bc16986c626291db34..60ffcb1a1221629e90e6ed962acada750830a342 100644 (file)
@@ -724,18 +724,9 @@ int write_mft_record_nolock(ntfs_inode *ni, MFT_RECORD *m, int sync)
         */
        if (!NInoTestClearDirty(ni))
                goto done;
-       /* Make sure we have mapped buffers. */
-       if (!page_has_buffers(page)) {
-no_buffers_err_out:
-               ntfs_error(vol->sb, "Writing mft records without existing "
-                               "buffers is not implemented yet.  %s",
-                               ntfs_please_email);
-               err = -EOPNOTSUPP;
-               goto err_out;
-       }
+       BUG_ON(!page_has_buffers(page));
        bh = head = page_buffers(page);
-       if (!bh)
-               goto no_buffers_err_out;
+       BUG_ON(!bh);
        nr_bhs = 0;
        block_start = 0;
        m_start = ni->page_ofs;
@@ -892,6 +883,12 @@ static int ntfs_mft_writepage(struct page *page, struct writeback_control *wbc)
        ntfs_debug("Entering for %i inodes starting at 0x%lx.", nr, mft_no);
        /* Iterate over the mft records in the page looking for a dirty one. */
        maddr = (u8*)kmap(page);
+       /*
+        * Clear the page uptodate flag.  This will cause anyone trying to get
+        * hold of the page to block on the page lock in read_cache_page().
+        */
+       BUG_ON(!PageUptodate(page));
+       ClearPageUptodate(page);
        for (i = 0; i < nr; ++i, ++mft_no, maddr += vol->mft_record_size) {
                struct inode *vi;
                ntfs_inode *ni, *eni;
@@ -1034,6 +1031,7 @@ static int ntfs_mft_writepage(struct page *page, struct writeback_control *wbc)
                up(&ni->extent_lock);
                iput(vi);
        }
+       SetPageUptodate(page);
        kunmap(page);
        /* If a dirty mft record was found, redirty the page. */
        if (is_dirty) {