All of lore.kernel.org
 help / color / mirror / Atom feed
From: Suresh Jayaraman <sjayaraman-IBi9RG/b67k@public.gmane.org>
To: Jeff Layton <jlayton-vpEMnDpepFuMZCB2o+C8xQ@public.gmane.org>
Cc: Pavel Shilovsky <piastry-7qunaywFIewox3rIn2DAYQ@public.gmane.org>,
	linux-cifs-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
Subject: Re: [PATCH] CIFS: Fix mkdir/rmdir bug for the non-POSIX case
Date: Mon, 13 Feb 2012 12:56:40 +0530	[thread overview]
Message-ID: <4F38BB30.9030107@suse.com> (raw)
In-Reply-To: <20120210132216.03badf59-9yPaYZwiELC+kQycOl6kW4xkIHaj4LzF@public.gmane.org>

On 02/10/2012 11:52 PM, Jeff Layton wrote:
> On Thu,  9 Feb 2012 21:08:12 +0300
> Pavel Shilovsky <piastry-7qunaywFIewox3rIn2DAYQ@public.gmane.org> wrote:
> 
>> Currently we do inc_nlink/drop_nlink for a parent directory for every
>> mkdir and rmdir calls. That's wrong when POSIX extensions are disabled
>> because in this case a server doesn't do the same things and returns
>> the old value on the next QueryInfo request. As the result, we update
>> our value with the server one and then decrement it on every rmdir
>> call - go to negative nlink values.
>>
>> Fix this by doing inc_nlink/drop_nlink for parent directory in mkdir
>> and rmdir in POSIX case only. Also add cERROR when nlink value <= 2
>> and we still try to decrement it (possible broken servers).
>>
> 
> Rather than doing that, I think it would be better not to do the
> inc/dec_nlink in either case and instead to set cifsi->time on the
> parent to 0 for both cases.
> 
> That should force it to have the directory attributes refetched at the
> next opportunity. Since we're not doing that now, we're likely missing
> out on stuff like directory mtime changes as well.
> 

Hmm.. don't we have to do both? Keep the nlink value sane and force
refetching attrs. Wondering if we don't update nlink what will happen in
cases

   (a) when mkdir/rmdir is run in a tight loop
   (b) when a dir is moved from one to another within the cifs mount


Thanks
Suresh

  parent reply	other threads:[~2012-02-13  7:26 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-02-09 18:08 [PATCH] CIFS: Fix mkdir/rmdir bug for the non-POSIX case Pavel Shilovsky
     [not found] ` <1328810892-21925-1-git-send-email-piastry-7qunaywFIewox3rIn2DAYQ@public.gmane.org>
2012-02-10  2:15   ` Shirish Pargaonkar
     [not found]     ` <CADT32e+BPaJebN=tz27pGh-=sTwvyszBK1F9E7LVKrvFpxb0Zw-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2012-02-10  6:11       ` Pavel Shilovsky
2012-02-10 18:22   ` Jeff Layton
     [not found]     ` <20120210132216.03badf59-9yPaYZwiELC+kQycOl6kW4xkIHaj4LzF@public.gmane.org>
2012-02-12 18:47       ` Pavel Shilovsky
2012-02-13  7:26       ` Suresh Jayaraman [this message]
     [not found]         ` <4F38BB30.9030107-IBi9RG/b67k@public.gmane.org>
2012-02-13 13:35           ` Jeff Layton
     [not found]             ` <20120213083544.486aa192-9yPaYZwiELC+kQycOl6kW4xkIHaj4LzF@public.gmane.org>
2012-02-13 16:00               ` Steve French
     [not found]                 ` <CAH2r5msQm=3EAqBmjHqWVHP2Gu_X8UMhwcjfC8agqvvc1boEsg-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2012-02-15 18:09                   ` Pavel Shilovsky
     [not found]                     ` <CAKywueR7Lyy63SJpQS8au=_EDzYGDJHKA0U9KOpxneyk2V9t8g-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2012-02-16 10:51                       ` Jeff Layton

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4F38BB30.9030107@suse.com \
    --to=sjayaraman-ibi9rg/b67k@public.gmane.org \
    --cc=jlayton-vpEMnDpepFuMZCB2o+C8xQ@public.gmane.org \
    --cc=linux-cifs-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=piastry-7qunaywFIewox3rIn2DAYQ@public.gmane.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.