From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-oi0-f54.google.com ([209.85.218.54]:36146 "EHLO mail-oi0-f54.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751268AbcL1KDp (ORCPT ); Wed, 28 Dec 2016 05:03:45 -0500 Received: by mail-oi0-f54.google.com with SMTP id v84so367328154oie.3 for ; Wed, 28 Dec 2016 02:03:45 -0800 (PST) MIME-Version: 1.0 From: Pranay Srivastava Date: Wed, 28 Dec 2016 15:33:44 +0530 Message-ID: Subject: Need some help regarding write_begin, write_end and writepage(s). To: linux-fsdevel@vger.kernel.org Content-Type: text/plain; charset=UTF-8 Sender: linux-fsdevel-owner@vger.kernel.org List-ID: Hello, I'm trying to understand the write_begin, write_end and writepages / writepage call sequence by having a small file system coded myself. I'm not using block_write_begin / block_write_end also not using mpage_writepages as well. The issue however is that apart from write_begin and write_end, writepages never gets called. However if I do write_inode_now ( in write_end) then writepage do get called, but that's not how it's supposed to be. 1. in write_begin : I'm able to grab_cache_page_begin and returned it locked. 2. in write_end: I'm able to allocate disk space and do SetPageDirty and SetPageUptodate unlock_page and page_cache_release. 3. I also tried __mark_inode_dirty(inode, I_DIRTY_PAGES) 4. I also tried to set_page_writeback, but apparently that then makes the iput_final stuck since it waits for PG_Writeback to be cleared and that I've coded in writepage which never gets called. but writepages never gets called. Even iput_final doesn't make the write_inode_now call. Any help would be appreciated. Regards,